Disable / Switch off Ehcache3

899 views Asked by At

Anybody knows how to switch off ehcache 3 in an application? (e.g. for testing purposes or fall back scenarios in production)

  • For ehcache 2 this was possible with: net.sf.ehcache.disabled=true as described here
  • How to disable all caches in ehcache3 (prefered via ehcache.xml)?
    • org.ehcache.core.Ehcache does not consist any disable functionallity
    • Is setting <heap unit="MB">0</heap> in ehcache.xml in a valid option?
    • I use JCache (aka JSR-107) with ehcache3 as implementation, maybe this give some more choices?
1

There are 1 answers

0
Louis Jacomet On BEST ANSWER

There is no such thing in Ehcache 3 at the moment. JCache does not have that option either.

You cannot size a resource to 0 so that's not an option either.

From here, two options:

  • add a layer in your application doing the indirection and add the disabled support to that.
  • Make a feature request on the Ehcache users mailing list to get it considered for addition.