code: protected boolean allowServePrecompressedResource(HttpServletRequest request, String url) {
  
          String accept = request.getHeader("Accept-Encoding");
          return (accept != null)
              && accept.contains("gzip")
              && (url.endsWith(".js") || url.endsWith(".css") || url.endsWith(".html"));
      }
docs: Returns whether this servlet should attempt to serve a precompressed
  version of the given static resource. If this method returns true, the
  suffix {@code .gz} is appended to the URL and the corresponding resource
  is served if it exists. It is assumed that the compression method used is
  gzip. If this method returns false or a compressed version is not found,
  the original URL is used.<p>
  
  The base implementation of this method returns true if and only if the
  request indicates that the client accepts gzip compressed responses and
  the filename extension of the requested resource is .js, .css, or .html.<p>
  
  @param request the request for the resource
  @param url the URL of the requested resource
  
  @return true if the servlet should attempt to serve a precompressed version of the resource, false otherwise