Class CacheFilter
java.lang.Object
org.eclipse.rdf4j.workbench.proxy.CacheFilter
- All Implemented Interfaces:
javax.servlet.Filter
Resource cache expiry filter for Tomcat 6, based on code authored by Saket Kumar.
- Author:
- Dale Visser
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longMaximum allowed expiry lifetime in seconds, set to one year according to the advice in RFC 2616.static final longMinimum allowed expiry lifetime, zero, which corresponds to not caching at all. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Make stored references available for garbage collection.voiddoFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) Set a maximum expiry Cache-Control header applicable to the client and to intermediate caching servers.voidinit(javax.servlet.FilterConfig config) Parse the Cache-Control configuration parameter as a long integer, and set the filter expiry value, modulo the minimum and maximum expiry constraints.
-
Field Details
-
MAX_EXPIRY
public static final long MAX_EXPIRYMaximum allowed expiry lifetime in seconds, set to one year according to the advice in RFC 2616.- See Also:
-
MIN_EXPIRY
public static final long MIN_EXPIRYMinimum allowed expiry lifetime, zero, which corresponds to not caching at all.- See Also:
-
-
Constructor Details
-
CacheFilter
public CacheFilter()
-
-
Method Details
-
doFilter
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException Set a maximum expiry Cache-Control header applicable to the client and to intermediate caching servers.- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
init
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException Parse the Cache-Control configuration parameter as a long integer, and set the filter expiry value, modulo the minimum and maximum expiry constraints. If the configuration parameter is not present, or not a valid long integer value, then no Cache-Control headers will be applied by the filter.- Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException- See Also:
-
destroy
public void destroy()Make stored references available for garbage collection.- Specified by:
destroyin interfacejavax.servlet.Filter
-