My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

Introduction

Java EE Cache Filter provides a collection of common Servlet filters for Java web applications based on the Servlet 2.5 specification. It allows you to transparently set HTTP cache headers in order to enable browser caching.

Why does cache matter?

From Best Practices for Speeding Up Your Web Site:

Web page designs are getting richer and richer, which means more scripts, stylesheets, images, and Flash in the page. A first-time visitor to your page may have to make several HTTP requests, but by using the Expires header you make those components cacheable. This avoids unnecessary HTTP requests on subsequent page views. Expires headers are most often used with images, but they should be used on all components including scripts, stylesheets, and Flash components.
Browsers (and proxies) use a cache to reduce the number and size of HTTP requests, making web pages load faster.

Filters

Currently Java EE Cache Filter has the following components.

Filter Description
CacheFilter Allows you to enable browser caching for requested resources.
NoCacheFilter Allows you to completely disable browser caching for requested resources.
NoETagFilter Allows you to disable HTTP ETag headers set by most Java web containers (e.g. Tomcat).

Maven Configuration

Add the following dependency to your pom.xml file.

<dependency>
    <groupId>com.samaxes.filter</groupId>
    <artifactId>cachefilter</artifactId>
    <version>2.0</version>
</dependency>
Powered by Google Project Hosting