I am trying to make my web application faster by using caching of web pages for faster access next time so can anyone provide me guideline how to use Ehcache for the same?
The Ehcache documentation on web caching should be a good start. For a quick start they also have a code sample / recipe on that.
EDIT: (how to see if it's working)
net.sf.ehcache.constructs.web.filter (e.g. DEBUG level) and look at the log entriesSimplePageCachingFilter is gzipping the response; look for Content-Encoding: gzip in HTTP response headers - Content-Length should be smaller than beforeehcache.xml: configure cache to overflowToDisk="true" and set <diskStore path="target/ehcache-diskStore"/> - a (at first empty) file named SimplePageCachingFilter.data should have been created thereIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With