code: @Override
      public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
          HttpServletRequest request = (HttpServletRequest) servletRequest;
  
          String uri = request.getRequestURI();
  
          // check if this is a servletRequest to a static resource, like images/css/js
          // if yes, add the servletResponse header
          boolean staticResource = isStaticResource(uri);
  
          filterChain.doFilter(servletRequest, servletResponse);
  
          // if static resources
          if(staticResource) {
              LOGGER.debug("Marking URI: {} as a static resource", uri);
              HttpServletResponse response = (HttpServletResponse) servletResponse;
              response.addDateHeader("Expires", System.currentTimeMillis() + DateUtils.ONE_YEAR);
              response.addHeader("Cache-Control", "public, max-age=" + ONE_YEAR_AS_SECONDS);
  
              // turn the line below to check if a resource was cached due to this filter
              // response.addHeader("X-Filter", "LeverageBrowserCache");
          }
      }
docs: Execute the filter by appending the <b>Expires</b> and
  <b>Cache-Control</b> response headers.
  
  @param servletRequest
  the incoming {@link ServletRequest} instance
  
  @param servletResponse
  the outgoing {@link ServletResponse} instance
  
  @param filterChain
  the {@link FilterChain} being executed
  
  @throws IOException
  if something fails
  
  @throws ServletException
  if something fails
  
  @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
  javax.servlet.ServletResponse, javax.servlet.FilterChain)