Home

Disable Ehcaches UpdateChecker in Grails application

This memo shows how to disable Ehcaches UpdateChecker in Grails applications

I found it pretty annoying that Ehcache always reminded me that there is an update to a newer version of its framework available. After searching the web I found an interesting thread in the Terracotta forum saying that the UpdateChecker is not only looking for updates. In addition it also submits information about the applications environment to Terracotta by default. And that is not a good thing in my opinion.

Here you can see youself: http://svn.terracotta.org/svn/ehcache/tags/ehcache-1.7.1/core/src/main/java/net/sf/ehcache/util/UpdateChecker.java

Fortunately you can disable this behavior by adding an Ehcache configuration to your Grails application. I have tested this with a Grails 1.2.0 application which includes Ehcache 1.7.1.

Simply place an ehcache.xml file in your <app-root>/grails-app/conf folder containing your Ehcache configuration. For this post I am using the configuration that ships with Ehcache as default (ehcache-failsafe.xml) and modify it.

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false">
  <diskStore path="java.io.tmpdir"/>
  <defaultCache
    maxElementsInMemory="10000"
    eternal="false"
    timeToIdleSeconds="120"
    timeToLiveSeconds="120"
    overflowToDisk="true"
    maxElementsOnDisk="10000000"
    diskPersistent="false"
    diskExpiryThreadIntervalSeconds="120"
    memoryStoreEvictionPolicy="LRU"
  />
</ehcache>

With the attribute updateCheck="false" in the root tag the haunting is gone.

XML Schema for Ehcache config can be found here: http://ehcache.org/ehcache.xsd

More Information about Ehcache configuration: http://ehcache.org/documentation/configuration.html


Date published:
Date modified: 2010-02-27
Keywords: Grails, Ehcache, UpdateChecker