Package tech.jhipster.web.filter
Class CachingHttpHeadersFilter
java.lang.Object
tech.jhipster.web.filter.CachingHttpHeadersFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
This filter is used in production, to put HTTP cache headers with a long (4 years) expiration time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstantDEFAULT_DAYS_TO_LIVE=1461static final longConstantDEFAULT_SECONDS_TO_LIVE=TimeUnit.DAYS.toSeconds(DEFAULT_DAYS_TO_LIVE) -
Constructor Summary
ConstructorsConstructorDescriptionCachingHttpHeadersFilter(JHipsterProperties jHipsterProperties) Constructor for CachingHttpHeadersFilter. -
Method Summary
-
Field Details
-
DEFAULT_DAYS_TO_LIVE
public static final int DEFAULT_DAYS_TO_LIVEConstantDEFAULT_DAYS_TO_LIVE=1461- See Also:
-
DEFAULT_SECONDS_TO_LIVE
public static final long DEFAULT_SECONDS_TO_LIVEConstantDEFAULT_SECONDS_TO_LIVE=TimeUnit.DAYS.toSeconds(DEFAULT_DAYS_TO_LIVE)
-
-
Constructor Details
-
CachingHttpHeadersFilter
Constructor for CachingHttpHeadersFilter.
- Parameters:
jHipsterProperties- aJHipsterPropertiesobject.
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig filterConfig) - Specified by:
initin interfacejakarta.servlet.Filter
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Filter
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-