Hemant Metalia
Hemant Metalia

Reputation: 30698

Web page caching using Ehcache

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?

Upvotes: 3

Views: 4816

Answers (1)

jeha
jeha

Reputation: 10750

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)

  1. enable logging for package net.sf.ehcache.constructs.web.filter (e.g. DEBUG level) and look at the log entries
  2. SimplePageCachingFilter is gzipping the response; look for Content-Encoding: gzip in HTTP response headers - Content-Length should be smaller than before
  3. ehcache.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 there
  4. JMX / cache statistics (more complicated; see JMX-Tutorial)
  5. ...

Upvotes: 1

Related Questions