• New Feature
  • Status: Reopened
  • 2 Major
  • Resolution:
  • prodmgmt
  • Reporter: mschip
  • April 18, 2012
  • 2
  • Watchers: 5
  • October 10, 2012


The Page and PageFragment Cache functionality of EHCache is extremely broad stroked and in most cases not very useful. Typically, a web developer needs more fine grained control over what to cache in a page. And for this purpose a JPS taglibrary would be useful. OSCache had one of those (http://java.net/projects/oscache/sources/svn/show/branches/v2_1_1/src/core/java/com/opensymphony/oscache/web/tag?rev=344) and perhaps it could be ported to EHCache or used as inspiration. Grails also has such a tag available but it’s specific to grails.

The general structure of the tag would be

<ehcache:cache name="myCache" key="myUrl" condition="true|false">
...cacheable content...

name: the name of the cache defined in ehcache.xml key: a unique key under which to store the content condition: a boolean that determines whether to cache or not. If false, the code between ehcache:cache tags will be normally processed.

It could be beneficial to be able to expire a cache key also

<ehcache:expire name="myCache" key="myUrl"/>

<ehcache:expire name="myCache" allEntries="true"/>

name: the name of the cache defined in ehcache.xml key: a unique key under which content is stored allEntries: whether to expire all entries in the cache

A caching tag library would be the perfect complement to EHCache and I’m sure it would speed up my pages considerably.


Fiona OShea 2012-04-23

This would be a great community project

Marc Schipperheyn 2012-10-08

It’s not entirely clear what the status is of this item. It’s marked resolved but doesn’t have a target release date or relevant comment associated with it. Also strange that an Anonymous user made these changes.

Fiona OShea 2012-10-10

This was inadvertently resolved. Re-opening and investigating the “Anonymous” closing issue. Thank you for commenting to bring it to our attention.