My current config is as below, I intended to only cache up to 30 elements and evict the oldest one when the number is more than 30:
<ehcache>
<diskStore path="/path/to/store/"></diskStore>
<cache name="myCache"
eternal="false"
maxEntriesLocalHeap="30"
maxEntriesLocalDisk="30"
memoryStoreEvictionPolicy="FIFO">
<persistence strategy="localTempSwap"/>
</cache>
</ehcache>
I have another scheduled job which runs every minute to put a new element into the cache. So I expect to get only 30 elements within recent 30 minutes. But the expiring/eviction was not as expected. Some very old elements were still kept while some elements within recent 30 minutes were unexpectedly evicted. Is there anything I missed here?
I've read through the expiring/eviction related documentation in ehcache, but did not find any clue. Hope someone can help :)
BTW, the ehcache version is 2.6.6