Closed jivkodobrev closed 1 month ago
<cache name="indirectly_related_offers"
maxElementsInMemory="500" timeToLiveSeconds="1200" timeToIdleSeconds="1200"
eternal="false" memoryStoreEvictionPolicy="LRU" overflowToDisk="false"/>
would map to:
<cache alias="indirectly_related_offers">
<resources>
<heap unit="entries">500</heap>
</resources>
<expiry>
<ttl unit="minutes">20</ttl>
</expiry>
</cache>
Couple of things to note here:
overflowToDisk="false"
translates to nothing since in Ehcache 3 only the resources you declare will be used.eternal="false"
is redundant in your Ehcache 2 config since you specify a TTI and TTL.memoryStoreEvictionPolicy
is not configurable in Ehcache 3.
I am migrating from Spring 2.x / EHCache 2.x to Spring 3.x / EHCache 3.x We have an XML configuration file with about 15 caches defined in an XML file
I am unable to find matching XML settings for items like
Example cache definition I am trying to upgrade:
This is the XSD of ehcache 3.x I am looking at: https://www.ehcache.org/documentation/3.8/xsds.html#core
Can you provide details on how to author the 3.x XML config file to preserve the 2.x cache settings? E.g. LRU/LFU policy?
In addition, migration to EHCache 3.x is clumsy. In 2.x EhCacheCacheManager implemented Spring's CacheManager interface and I was able to use it in our configuration side-by-side with Redis in Spring. Now I have a clumsy code like this:
Unless you can provide a better approach?
TL;DR - my primary issue here is to define xml configuration in EHCache 3.x to match my 2.x XML configuration.
Thank you in advance