My Goal: I want to configure ehcache to use the hard drive for caching. Ideally cache content will survive application restarts.
Context: play 2.2 application with play-cache_2.10-2.2.2.jar and ehcache-core-2.6.6.jar on classpath
Try: I haven't tried too much yet, because the first attempt indicates that I'm missing something fundamentally.
I just created a ehcache.xml file under app/conf
<ehcache>
<diskStore path="/var/myapp/persistent/cache>
<defaultCache
maxBytesLocalHeap="512M"
eternal="false"
timeToIdleSeconds="90000"
timeToLiveSeconds="0"
maxBytesLocalDisk="10G"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LFU">
<persistence strategy="localRestartable" />
</defaultCache>
</ehcache>
Complains:
net.sf.ehcache.config.InvalidConfigurationException:
Cannot use localRestartable persistence and disk overflow in the same cache
...
net.sf.ehcache.CacheManager.addCache(CacheManager.java:1177)
play.api.cache.EhCachePlugin.cache$lzycompute(Cache.scala:143)
play.api.cache.EhCachePlugin.cache(Cache.scala:142)
play.api.cache.EhCachePlugin.onStart(Cache.scala:159)
...
Question: How can I change persistence strategy to something different than disk overflow? How can I configure ehcache to use the hard drive for caching?
According to the EhCache documentation here
The BigMemory Go is a paid product from Terracotta which is not open source. This maybe why you are getting the error.