Class CachingHttpHeadersFilter

java.lang.Object
tech.jhipster.web.filter.CachingHttpHeadersFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class CachingHttpHeadersFilter extends Object implements jakarta.servlet.Filter
This filter is used in production, to put HTTP cache headers with a long (4 years) expiration time.
  • Field Details

    • DEFAULT_DAYS_TO_LIVE

      public static final int DEFAULT_DAYS_TO_LIVE
      Constant DEFAULT_DAYS_TO_LIVE=1461
      See Also:
    • DEFAULT_SECONDS_TO_LIVE

      public static final long DEFAULT_SECONDS_TO_LIVE
      Constant DEFAULT_SECONDS_TO_LIVE=TimeUnit.DAYS.toSeconds(DEFAULT_DAYS_TO_LIVE)
  • Constructor Details

    • CachingHttpHeadersFilter

      public CachingHttpHeadersFilter(JHipsterProperties jHipsterProperties)

      Constructor for CachingHttpHeadersFilter.

      Parameters:
      jHipsterProperties - a JHipsterProperties object.
  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig filterConfig)
      Specified by:
      init in interface jakarta.servlet.Filter
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.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:
      doFilter in interface jakarta.servlet.Filter
      Throws:
      IOException
      jakarta.servlet.ServletException