public class ExpiresFilter extends java.lang.Object implements Filter
The cache-time init-parameter configures how long the page should be cached:
<filter> <filter-name>expires-cache</filter-name> <filter-class>com.caucho.http.filter.ExpiresFilter</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 |
Constructor and Description |
---|
ExpiresFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Any cleanup for the filter.
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain nextFilter)
The filter add an Expires time in the future.
|
void |
init(FilterConfig config)
Filter init reads the filter configuration
|
void |
setCacheTime(Period period) |
public void setCacheTime(Period period)
public void init(FilterConfig config) throws ServletException
init
in interface Filter
ServletException
public void doFilter(ServletRequest request, ServletResponse response, FilterChain nextFilter) throws ServletException, java.io.IOException
doFilter
in interface Filter
request
- the servlet requestresponse
- the servlet responsenextFilter
- the next filter in the chainServletException
java.io.IOException