Caches the servlet output for anonymous users. This filter adds
an Expires header and the Cache-Control: x-anonymous header.
Requests from anonymous users, i.e. users with no JSESSIONID cookie
or ;jsessionid= URL-rewriting, will be cached. So logged-in users
will have customized pages, but anonymous users will see a cached page.
Since there are generally more anonymous users, using the
AnonymousExpiresFilter can dramatically improve performance without
losing the ability to customize pages.
Pages should call request.getSession(false) to get their
sessions, because a page that creates a session will not be cached.
For the same reason, JSP pages would set
<jsp:directive.page session='false'/> .
The cache-time init-parameter configures how long the page should be
cached:
<filter>
<filter-name>anonymous-cache</filter-name>
<filter-class>com.caucho.http.filter.AnonymousExpiresFilter</filter-class>
<init-param cache-time='10s'/>
</filter>
The cache-time allows the standard extensions:
s | seconds
| m | minutes
| h | hours
| D | days
| W | weeks
| M | months
| Y | years
|
since: Resin 2.0.5 |