Today found a development project started with a warning prompt: Cache ' xx ' is set to eternal but also has Ttl/tti set, found to be ehcache cache settings conflict
So decided to mark it here, to deepen the memory, specifically as follows:
Timetoliveseconds: Cache from the time of creation to the expiration of the time unit of seconds, the default is 0, representing an infinite length, that is, the cache never expires;
Timetoidleseconds: After the cache is created, the time interval at which the last access cache expires, the unit is seconds, the default is 0, never expires;
Eternal: Cache is permanently valid (True/false)
When you configure the Eternal property to True, if you configure Timetoliveseconds/timetoidleseconds to be not 0 at the same time, the program will report the above warning
Let's talk about the relationship between them:
Eternal, True indicates that the cache is permanently valid and false indicates that it is not permanently valid
Primarily for use between Timetoliveseconds and Timetoidleseconds (when individually configured, described above)
Examples: timetoliveseconds =3600 timetoidleseconds =300
The above configuration represents 3,600 seconds of cache validity (one hours since the cache was set up) and, in a valid one hours, if the cache is not accessed for five minutes in a row, the cache fails, especially if the cache access is never interrupted, and the cache expires after one hours.