Configure the store. The following options can be used:
maxobjects (10000) - The maximum number of objects in memory.
overflow-to-disk (true) - Whether to spool elements to disk after
maxobjects has been exceeded.
eternal (true) - whether or not entries expire. When set to
false the timeToLiveSeconds and
timeToIdleSeconds parameters are used to determine when an
item expires.
timeToLiveSeconds (0) - how long an entry may live in the cache
before it is removed. The entry will be removed no matter how frequently it is retrieved.
timeToIdleSeconds (0) - the maximum time between retrievals
of an entry. If the entry is not retrieved for this period, it is removed from the
cache.
use-cache-directory (false) - If true the cache-directory
context entry will be used as the location of the disk store.
Within the servlet environment this is set in web.xml.
use-work-directory (false) - If true the work-directory
context entry will be used as the location of the disk store.
Within the servlet environment this is set in web.xml.
directory - Specify an alternative location of the disk store.
Setting eternal to false but not setting
timeToLiveSeconds and/or timeToIdleSeconds , has the
same effect as setting eternal to true .
Here is an example to clarify the purpose of the timeToLiveSeconds and
timeToIdleSeconds parameters:
- timeToLiveSeconds = 86400 (1 day)
- timeToIdleSeconds = 10800 (3 hours)
With these settings the entry will be removed from the cache after 24 hours. If within
that 24-hour period the entry is not retrieved within 3 hours after the last retrieval, it will
also be removed from the cache.
By setting timeToLiveSeconds to 0 , an item can stay in
the cache as long as it is retrieved within timeToIdleSeconds after the
last retrieval.
By setting timeToIdleSeconds to 0 , an item will stay in
the cache for exactly timeToLiveSeconds .
disk-persistent Whether the disk store persists between restarts of
the Virtual Machine. The default value is true.
|