TimeToLiveSeconds and ehcache configuration timeToIdleSeconds

My application is sometimes not used for 24 hours or more, but when it receives a request, it is very slow because the data must be retrieved from the 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 hours (48 * 60 * 60 = 172,800) after the last access before the expiration date.

Does that make sense at all?

Thanks in advance,

Julien.

+4
source share
1 answer

That makes sense, the default settings of 120/120 are definitely not working for you. Also, make sure you set eternal = "false" because its true value overrides the TimeToIlele and TimeToLive settings.

+6
source

All Articles