Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinetrue

...

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

Ehcache is an enterprise grade, feature rich framework for applications requiring a coherent distributed cache.

Caches can be configured in Ehcache either declaratively, XML or programatically . 

Integration with ehcache.

...

  • 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", overrides timeToLive and timeToIdle so that no expiration can take place.

  • maxEntriesLocalHeap
     Sets the maximum number of objects that will be held on heap memory. 0 = no limit.

...