balteo
balteo

Reputation: 24679

timeToLiveSeconds and timeToIdleSeconds ehcache configuration

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 hours (48*60*60=172 800) after last access before expiring.

Does that make sense at all?

Thanks in advance,

Julien.

Upvotes: 4

Views: 7860

Answers (1)

Michael Lucas
Michael Lucas

Reputation: 783

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.

Upvotes: 6

Related Questions