Search code examples
javaehcacheehcache-3

Where is the web.xml for Ehcache 3?


I am trying to implement basic webpage caching, but having trouble finding resources with explanations. I keep finding code with no explanations or or explanations (in the docs) with no code. Can anyone provide a simple tutorial? As far as I can tell the steps are as follows:

  1. Implement a listener 4.1 directions (couldnt find a 3.0 version for this)

    1. add ehcache.xml (wrote my own simple one)

    2. add paths to web.xml- Here is a 2.7 version (couldn't find a 3.0 version)

Does anyone know where to find the correct files for an ehcache 3.0 implementation?


Solution

  • The web filter doesn't exist anymore in Ehcache 3. It was too specific. However, you can easily implement your own. Listeners have been removed as well. You won't need them.

    The first step would be to configure Ehcache. Have a look at the documentation and the samples.

    Then, just cache the pages. I recommend to use a simplified version of the Ehcache 2 filter.