|Configuring the Native Client Cache / Region Attributes|
Expiration attributes govern the automatic eviction of regions and region entries from the cache. Eviction is based on the time elapsed since the last update or access to the object. This is referred to as the least-recently-used (LRU) eviction process. Expiration options range from marking the expired object as invalid to completely removing it from the distributed cache. Eviction can help keep data current by removing outdated entries, prompting a reload the next time they are requested. Eviction may also be used to recover space in the cache by clearing out unaccessed entries and regions.
Similar to application plug-ins, expiration activities are hosted by each application that defines a region in its cache.
<region-attributes> <entry-idle-time> <expiration-attributes timeout="60" action="local-invalidate"/> </entry-idle-time> </region-attributes>
Region and region entry expiration attributes are set at the region level. By default, regions and entries do not expire. The following attributes cover two types of expiration: time-to-live (TTL) and idle timeout.
|RegionTimeToLive||Number of seconds that the region remains in the cache after the last creation or update before the expiration action occurs.|
|EntryTimeToLive||For entries, the counter is set to zero for create and put operations. Region counters are reset when the region is created and when an entry has its counter reset. An update to an entry causes the time-to-live (TTL) counters to be reset for the entry and its region.|
|RegionIdleTimeout||Number of seconds that the region remains in the cache after the last access before the expiration action occurs.|
The idle timeout counter for an object is reset when
its TTL counter is reset. An entry's idle timeout counter is also
reset whenever the entry is accessed through a get
The idle timeout counter for a region is reset whenever the idle timeout is reset for one of its entries.
Expiration is measured by comparing expiration attribute settings with the last accessed time and last modified time statistics. These statistics are directly available to applications through the CacheStatistics object that is returned by the Region::getStatistics and RegionEntry::getStatistics functions. The CacheStatistics object also provides a function for resetting the statistics counters.
Expiration activities in distributed regions can be distributed or performed only in the local cache. So one cache could control region expiration for a number of caches in the distributed system.