public class HttpCachingHeaderFilter extends Object implements javax.servlet.Filter
ServletResponse
, if applicable.
Caching is applicable, if the request URI does not contain a certain json file. If that is the case the response headers for caching are added depending on the previously set response content type. Static files such as stylesheets, scripts, fonts and images are not affected by this filter and will be left with the default caching behavior.
It is recommended to position this filter last in the servlet filter chain.
Modifier and Type | Field and Description |
---|---|
protected static Set<String> |
CACHEABLE_CONTENT_TYPES
The constant set of content types which are enabled by default for HTTP caching.
|
Constructor and Description |
---|
HttpCachingHeaderFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
void |
init(javax.servlet.FilterConfig filterConfig) |
public void init(javax.servlet.FilterConfig filterConfig)
init
in interface javax.servlet.Filter
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
Copyright © 2020 SAP SE. All rights reserved.