java - How to renew or invalidate cache using SimpleCachingPageFilter in Ehcache? -
we using web-ehcache's net.sf.ehcache.constructs.web.filter.simplepagecachingfilter, configured xml, cache page json message, message can changed administrator. how invalidate cache when administrator changes changes json message?
i figured out how make it:
cachemanager.getinstance().getehcache("cachename").removeall();
it gets singletone cachemanager, gets ehcache depending on name of cache, removes elements.
in next request cached page, filter looks ehcache, finds, without elementx , updates elements!
Comments
Post a Comment