| 1 |
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../main/config/ehcache.xsd"> |
| 2 |
|
| 3 |
<!-- Sets the path to the directory where cache .data files are created. |
| 4 |
|
| 5 |
If the path is a Java System Property it is replaced by |
| 6 |
its value in the running VM. Subdirectories can be specified below the property e.g. java.io.tmpdir/one |
| 7 |
|
| 8 |
The following properties are translated: |
| 9 |
user.home - User's home directory |
| 10 |
user.dir - User's current working directory |
| 11 |
java.io.tmpdir - Default temp file path --> |
| 12 |
<diskStore path="java.io.tmpdir"/> |
| 13 |
|
| 14 |
|
| 15 |
<!--Default Cache configuration. These will applied to caches programmatically created through |
| 16 |
the CacheManager. |
| 17 |
|
| 18 |
The following attributes are required: |
| 19 |
|
| 20 |
maxElementsInMemory - Sets the maximum number of objects that will be created in memory |
| 21 |
eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the |
| 22 |
element is never expired. |
| 23 |
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache |
| 24 |
has reached the maxInMemory limit. |
| 25 |
|
| 26 |
The following attributes are optional: |
| 27 |
timeToIdleSeconds - Sets the time to idle for an element before it expires. |
| 28 |
i.e. The maximum amount of time between accesses before an element expires |
| 29 |
Is only used if the element is not eternal. |
| 30 |
Optional attribute. A value of 0 means that an Element can idle for infinity. |
| 31 |
The default value is 0. |
| 32 |
timeToLiveSeconds - Sets the time to live for an element before it expires. |
| 33 |
i.e. The maximum time between creation time and when an element expires. |
| 34 |
Is only used if the element is not eternal. |
| 35 |
Optional attribute. A value of 0 means that and Element can live for infinity. |
| 36 |
The default value is 0. |
| 37 |
diskPersistent - Whether the disk store persists between restarts of the Virtual Machine. |
| 38 |
The default value is false. |
| 39 |
diskExpiryThreadIntervalSeconds- The number of seconds between runs of the disk expiry thread. The default value |
| 40 |
is 120 seconds. |
| 41 |
--> |
| 42 |
|
| 43 |
<defaultCache |
| 44 |
maxElementsInMemory="10" |
| 45 |
eternal="false" |
| 46 |
timeToIdleSeconds="5" |
| 47 |
timeToLiveSeconds="10" |
| 48 |
overflowToDisk="true" |
| 49 |
/> |
| 50 |
|
| 51 |
<!--Predefined caches. Add your cache configuration settings here. |
| 52 |
If you do not have a configuration for your cache a WARNING will be issued when the |
| 53 |
CacheManager starts |
| 54 |
|
| 55 |
The following attributes are required for defaultCache: |
| 56 |
|
| 57 |
name - Sets the name of the cache. This is used to identify the cache. |
| 58 |
It must be unique. |
| 59 |
maxElementsInMemory - Sets the maximum number of objects that will be created in memory |
| 60 |
eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the |
| 61 |
element is never expired. |
| 62 |
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache |
| 63 |
has reached the maxInMemory limit. |
| 64 |
|
| 65 |
The following attributes are optional: |
| 66 |
timeToIdleSeconds - Sets the time to idle for an element before it expires. |
| 67 |
i.e. The maximum amount of time between accesses before an element expires |
| 68 |
Is only used if the element is not eternal. |
| 69 |
Optional attribute. A value of 0 means that an Element can idle for infinity. |
| 70 |
The default value is 0. |
| 71 |
timeToLiveSeconds - Sets the time to live for an element before it expires. |
| 72 |
i.e. The maximum time between creation time and when an element expires. |
| 73 |
Is only used if the element is not eternal. |
| 74 |
Optional attribute. A value of 0 means that and Element can live for infinity. |
| 75 |
The default value is 0. |
| 76 |
diskPersistent - Whether the disk store persists between restarts of the Virtual Machine. |
| 77 |
The default value is false. |
| 78 |
diskExpiryThreadIntervalSeconds- The number of seconds between runs of the disk expiry thread. The default value |
| 79 |
is 120 seconds. |
| 80 |
--> |
| 81 |
|
| 82 |
<!-- Sample cache named sampleCache1 --> |
| 83 |
<cache name="sampleCache1" |
| 84 |
maxElementsInMemory="10000" |
| 85 |
eternal="false" |
| 86 |
timeToIdleSeconds="360" |
| 87 |
timeToLiveSeconds="1000" |
| 88 |
overflowToDisk="true" |
| 89 |
/> |
| 90 |
|
| 91 |
<!-- Sample cache named sampleCache2. Is eternal --> |
| 92 |
<cache name="sampleCache2" |
| 93 |
maxElementsInMemory="1000" |
| 94 |
eternal="true" |
| 95 |
overflowToDisk="false" |
| 96 |
/> |
| 97 |
|
| 98 |
<!-- Sample cache named sampleCacheNoIdle, which does not specify the optional idle time --> |
| 99 |
<cache name="sampleCacheNoIdle" |
| 100 |
maxElementsInMemory="1000" |
| 101 |
eternal="false" |
| 102 |
timeToLiveSeconds="5" |
| 103 |
overflowToDisk="false" |
| 104 |
/> |
| 105 |
|
| 106 |
<!-- Sample cache named sampleCacheNotEternalButNoIdleOrExpiry --> |
| 107 |
<cache name="sampleCacheNotEternalButNoIdleOrExpiry" |
| 108 |
maxElementsInMemory="1000" |
| 109 |
eternal="false" |
| 110 |
overflowToDisk="false" |
| 111 |
/> |
| 112 |
|
| 113 |
<!-- A cache with short idle and live expiries, suitable for tests --> |
| 114 |
<cache name="sampleIdlingExpiringCache" |
| 115 |
maxElementsInMemory="1" |
| 116 |
eternal="false" |
| 117 |
timeToIdleSeconds="2" |
| 118 |
timeToLiveSeconds="5" |
| 119 |
overflowToDisk="true" |
| 120 |
/> |
| 121 |
|
| 122 |
<!-- A cache which overflows to disk. The disk store is persistent |
| 123 |
between cache and VM restarts. The disk expiry thread interval is set to 10 minutes, overriding |
| 124 |
the default of 2 minutes. --> |
| 125 |
<cache name="persistentLongExpiryIntervalCache" |
| 126 |
maxElementsInMemory="500" |
| 127 |
eternal="false" |
| 128 |
timeToIdleSeconds="300" |
| 129 |
timeToLiveSeconds="600" |
| 130 |
overflowToDisk="true" |
| 131 |
diskPersistent="true" |
| 132 |
diskExpiryThreadIntervalSeconds="600" |
| 133 |
/> |
| 134 |
|
| 135 |
<!-- Page Caches --> |
| 136 |
|
| 137 |
<cache name="CachedLogin" |
| 138 |
maxElementsInMemory="10" |
| 139 |
eternal="false" |
| 140 |
timeToIdleSeconds="10000" |
| 141 |
timeToLiveSeconds="10000" |
| 142 |
overflowToDisk="true" |
| 143 |
/> |
| 144 |
|
| 145 |
<cache name="FooterPageCache" |
| 146 |
maxElementsInMemory="10" |
| 147 |
eternal="false" |
| 148 |
timeToIdleSeconds="10000" |
| 149 |
timeToLiveSeconds="10000" |
| 150 |
overflowToDisk="true" |
| 151 |
/> |
| 152 |
|
| 153 |
</ehcache> |