How to Set up a cache filter for Tomcat or JBoss

Set up a cache filter for Tomcat or JBoss

You can set up a cache filter so that static files (image files, CSS files, and JavaScript files) don't expire. When the expires header is set to sometime in the future, the browser will immediately get those static files from its cache, if they exist, and only make the server request if it doesn't have them. If the expires header is not set to the future the the browser sends a conditional request to the server asking if the file has changed, then the server returns an HTTP 304 response if the file has not changed. Many JasperReport pages have 100 or more static files, so elliminating these round trips can significantly lighten the server load. Typically we see around 10% improvement in performance and in some cases as much as 50% improvement.

See Also:


Other Performance Tips: