Package io.github.jhipster.web.filter
Class CachingHttpHeadersFilter
- java.lang.Object
-
- io.github.jhipster.web.filter.CachingHttpHeadersFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class CachingHttpHeadersFilter extends Object implements javax.servlet.Filter
This filter is used in production, to put HTTP cache headers with a long (4 years) expiration time.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_DAYS_TO_LIVEConstantDEFAULT_DAYS_TO_LIVE=1461static longDEFAULT_SECONDS_TO_LIVEConstantDEFAULT_SECONDS_TO_LIVE=TimeUnit.DAYS.toMillis(DEFAULT_DAYS_TO_LIVE)
-
Constructor Summary
Constructors Constructor Description CachingHttpHeadersFilter(JHipsterProperties jHipsterProperties)Constructor for CachingHttpHeadersFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)voidinit(javax.servlet.FilterConfig filterConfig)
-
-
-
Field Detail
-
DEFAULT_DAYS_TO_LIVE
public static final int DEFAULT_DAYS_TO_LIVE
ConstantDEFAULT_DAYS_TO_LIVE=1461- See Also:
- Constant Field Values
-
DEFAULT_SECONDS_TO_LIVE
public static final long DEFAULT_SECONDS_TO_LIVE
ConstantDEFAULT_SECONDS_TO_LIVE=TimeUnit.DAYS.toMillis(DEFAULT_DAYS_TO_LIVE)
-
-
Constructor Detail
-
CachingHttpHeadersFilter
public CachingHttpHeadersFilter(JHipsterProperties jHipsterProperties)
Constructor for CachingHttpHeadersFilter.
- Parameters:
jHipsterProperties- aJHipsterPropertiesobject.
-
-
Method Detail
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
-