docs: @Override
  	public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
          HttpServletRequest request = (HttpServletRequest) servletRequest;
  
          String uri = request.getRequestURI();
          if(!uri.endsWith(".js")) {
              filterChain.doFilter(servletRequest, servletResponse);
              return;
          }
  
          // check if we have this in cache
          if(CACHE.containsKey(uri)) {
              ModifiedServletResponse cr = CACHE.get(uri);
              cr.copyToResponse(servletResponse);
              return;
          }
  
          // not in cache, obtain fresh response
          HttpServletResponseWrapperImpl wrapper = new HttpServletResponseWrapperImpl(servletResponse);
          filterChain.doFilter(servletRequest, wrapper);
  
          // flush buffer so that we can read everything
          wrapper.flushBuffer();
  
          // check for empty response
          byte[] bytes = wrapper.getBytes();
          if(bytes == null || bytes.length == 0) {
              wrapper.copyToResponse(servletResponse);
              return;
          }
  
          // check if output is of type text/javascript
          final String type = wrapper.getContentType();
          final String encoding = wrapper.getCharacterEncoding();
  
          LOGGER.info("Content encoding being sent to client: " + encoding);
          LOGGER.info("Content type being sent to client: " + type);
  
          // check if we are JS
          if(type != null && !isJavascript(type)) {
              // no JS
              // output as such
              wrapper.copyToResponse(servletResponse);
              return;
          }
  
          // add marker that we processed data
          wrapper.addHeader("X-Jerry-Minified", "true");
  
          // check if this is gzip-compressed bytes
          byte[] newBytes = bytes;
          if(isGZip(bytes)) {
              newBytes = unGZip(bytes);
          }
  
          // check if we have something here
          if(newBytes == null) {
              wrapper.copyToResponse(servletResponse);
              return;
          }
  
          // go ahead and compress this data
          String jsCode = null;
          if (encoding != null) {
              try {
                  jsCode = new String(newBytes, encoding);
              } catch (UnsupportedEncodingException e) {
                  LOGGER.error("Unable to encode byte response to string for encoding: " + encoding, e);
              }
          } else {
              jsCode = new String(newBytes);
          }
  
          // compress the code
          String compressedCode = null;
          try {
              compressedCode = compressJavascriptEmbedded(uri, jsCode);
          } catch(Exception e) {
              LOGGER.error("Unable to compress Javascript at URL: " + uri, e);
              wrapper.copyToResponse(servletResponse);
              return;
          }
  
          if(encoding != null) {
              bytes = compressedCode.getBytes(encoding);
          } else {
              bytes = compressedCode.getBytes();
          }
  
          // create CACHEABLE RESPONSE
          ResponseUtils.setCacheHeaders(wrapper, DateUtils.ONE_MONTH);
  
          ModifiedServletResponse cr = new ModifiedServletResponse(wrapper, bytes);
          CACHE.put(uri, cr);
  
          // write and move ahead
          cr.copyToResponse(servletResponse);
      }