Skip to content

Instantly share code, notes, and snippets.

@meddulla
Forked from oscarrenalias/ehcache.xml
Created August 23, 2017 13:24
Show Gist options
  • Save meddulla/217628446f88305b63ccc51291b38095 to your computer and use it in GitHub Desktop.
Save meddulla/217628446f88305b63ccc51291b38095 to your computer and use it in GitHub Desktop.
A better ehcache.xml configuration file for the Play Framework, which out of the box limits the size of the cache based on the number of objects you put in it rather than the number of bytes. I personally think that's not a very smart choice. Also see http://ehcache.org/documentation/2.5/configuration/cache-size#cache-configuration-sizing-attrib…
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../config/ehcache.xsd" updateCheck="false">
<!-- This is a default configuration for 256Mb of cached data using the JVM's heap, but it must be adjusted
according to specific requirement and heap sizes -->
<defaultCache
maxBytesLocalHeap="256000000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="false"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment