Table of Contents | ||
---|---|---|
|
Introduction
It might be painful to maintain an application specific cache when we are working on a distributed environment mainly because of the synchronization lag and data inconsistency issue. Best solution for this is to separate the cache to a different server and may be distribute it depending on the storage requirements.
Ehcache integration
Caches can be configured in Ehcache either declaratively, XML or programatically.
...
timeToLive
The maximum number of seconds an element can exist in the cache regardless of use. The element expires at this limit and will no longer be returned from the cache. The default value is 0, which means no TTL eviction takes place (infinite lifetime).
timeToIdle
The maximum number of seconds an element can exist in the cache without being accessed. The element expires at this limit and will no longer be returned from the cache. The default value is 0, which means no TTI eviction takes place (infinite lifetime).
- eternal
when set to "true", overridestimeToLive
andtimeToIdle
so that no expiration can take place. - maxEntriesLocalHeap
Sets the maximum number of objects that will be held on heap memory. 0 = no limit.
...