In ehcache 2.x version I have following configuration.
<cache name="basicCache"
maxEntriesLocalHeap="400"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false">
</cache>
Following is the corresponding ehcache 3.x version.
<ehcache:cache alias="basicCache">
<ehcache:key-type>java.lang.Long</ehcache:key-type>
<ehcache:value-type>java.lang.String</ehcache:value-type>
<ehcache:resources>
<ehcache:heap unit=entries">400</ehcache:heap>
</ehcache:resources>
</ehcache:cache>
can someone help me to configure below attributes in ehcache 3.5.2 version.
eternal="true" and overflowToDisk="false"
For setting eternal to true, which means the timeouts are ignored and cache will never expire. You can set this by setting expiry as none. Something like below,
<cache alias="backupCache">
<key-type>java.lang.String</key-type>
<value-type>java.lang.String</value-type>
<expiry>
<none/>
</expiry>
<resources>
<heap unit="entries">100</heap>
</resources>
</cache>
Hope this helps :)
overflowToDisk concept has been removed from the ehcache 3.x version.Refer this link for more details
https://groups.google.com/forum/#!topic/ehcache-users/FFHHhRW5hdg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With