I'd like to implement the following algorythm above Ehcache :
- try to get an element from the cache
- if the element is not expired
- serve the value
- else
- serve the expired value
- refresh the element in the background
But I never get an expired element (Element.isExpired()). I tried to play with my cache configuration (especially TimeToLive and TimeToIdle) but I cant seem to get it to work as I want. I can list the keys in the cache, but if I "get()" an expired element, I always get a null.
What am I doing wrong ?