Cache

The cache configuration provides a way to tune the setting used to setup the cache associated with various other configuration items, for example a Data Source based Data Definition.

The cache tag itself is not used as a top level configuration item but is instead embedded within other tags.

Namespace

urn:com.cohga.server.cache#1.0

Tags

cache

Properties

Name

Type

Required

Description

maxElementsInMemory

number

no

The maximum number of elements in memory, before they are evicted

maxElementsOnDisk

number

no

The maximum number of elements to hold on Disk

memoryStoreEvictionPolicy

'LRU', 'LFU', or 'FIFO'

no

Policy used to determine which items to remove, default is LRU

overflowToDisk

boolean

no

Whether to use the disk store

eternal

boolean

no

Whether the elements in the cache are eternal, i.e. never expire

timeToLiveSeconds

number

no

The default amount of time to live for an element from its creation date

timeToIdleSeconds

number

no

The default amount of time to live for an element from its last accessed or modified date

diskPersistent

boolean

no

Whether to persist the cache to disk between JVM restarts

diskExpiryThreadIntervalSeconds

number

no

How often to run the disk store expiry thread. A large number of 120 seconds plus is recommended

Sub-tags

None

Content

None

Examples

<cache:cache>
	<maxElementsInMemory>50</maxElementsInMemory>
	<memoryStoreEvictionPolicy>LRU</memoryStoreEvictionPolicy>
	<eternal>false</eternal>
	<timeToIdleSeconds>0</timeToIdleSeconds>
	<timeToLiveSeconds>300</timeToLiveSeconds>
	<overflowToDisk>true</overflowToDisk>
	<maxElementsOnDisk>2000</maxElementsOnDisk>
	<diskPersistent>false</diskPersistent>
	<diskExpiryThreadIntervalSeconds>120</diskExpiryThreadIntervalSeconds>
</cache:cache>
Disable caching
<cache:cache disable="true"/>