Versions Compared

Key

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

...

For example, by default, the EhCache provider will overflow the data to the system temp directory and will not persist the data across restarts. The following EhCache default configuration can be used to change it:

...

<ehcache xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false" monitoring="autodetect" dynamicConfig="true">

    <diskStore path="/home/username/work/ehcache"/>

    <defaultCache
            maxEntriesLocalHeap="5000"
            timeToIdleSeconds="3600"
            timeToLiveSeconds="3600"
            overflowToDisk="true"
            maxElementsOnDisk="10000000"
            diskPersistent="true"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />
</ehcache>

seen here. To change the default configuration, simply copy this file to a custom location and make whatever changes are required. Assuming this configuration is saved in WEB-INF/ehcache.xml, the EhCache provider can be configured as follows:

...