My app sometimes goes unused for 24 hours or more but when it does get a request, it is very slow because the data has to be fetched from database. Here is the current ehcache configuration:
timeToIdleSeconds="120"
timeToLiveSeconds="120"
I am considering using the following configuration:
timeToIdleSeconds="172800"
timeToLiveSeconds="0"
i.e. it never expires according to timeToLiveSeconds and the cache waits 48 ho开发者_如何转开发urs (48*60*60=172 800) after last access before expiring.
Does that make sense at all?
Thanks in advance,
Julien.
That makes sense, the default settings of 120/120 are definitely not working for you. Also make sure you set eternal="false", since having it true overrides the timeToIdle and timeToLive settings.
精彩评论