docs: private boolean setResponseHeaders(HttpServletRequest req, HttpServletResponse resp) throws IOException {
      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
          logger.entering(CLASS_NAME, "setResponseHeaders");
      }
      // Add date header as per RFC 2616 sec 14.18
      resp.setDateHeader("Date", System.currentTimeMillis());
  
      // begin pq65763
      String matchString = req.getRequestURI();
          // String type =
          // getServletContext().getMimeType(file.getAbsolutePath());
      String type = context.getMimeType(matchString);
      // end pq65763
      EncodingUtils.setContentTypeByCustomProperty(type, matchString, resp);
  
      String esiControl = parentProcessor.getEsiControl();
  
      // Add ESI control header, if
      // (1) ESI not disabled &
      // (2) capability header is in request &
      // (3) this is not a forward &
      // (4) control header wasn't already added (by dynacache)
      // (5) request is not authenticated
          if ((esiControl != null) && (req.getHeader("Surrogate-Capability") != null)
                  && (req.getAttribute(WebAppRequestDispatcher.DISPATCH_NESTED_ATTR) == null) && (!resp.containsHeader("Surrogate-Control"))
                  && (req.getAuthType() == null)) {
        resp.addHeader("Surrogate-Control", esiControl);
      }
  
      /*
           * A code change is being made for defect PQ42792. A 304 Response is
           * being sent back whenever the "If-Modified-Since" header matches the
           * Last Modified Date of the file. Else the file is read and returned to
           * the browser.
       */
  
      long ModifiedSince = -1;
          try {
        ModifiedSince = req.getDateHeader("If-Modified-Since");
          } catch (IllegalArgumentException iae) {
        ModifiedSince = -1;
      }
      long FileModified = getLastModified();
  
      // PK65384 start
          if (FileModified == 0 && !isAvailable()) {
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
          logger.logp(Level.FINE, CLASS_NAME, "setResponseHeaders", "isAvailable false, setting 404 status");
        }
              resp.sendError(HttpServletResponse.SC_NOT_FOUND, MessageFormat.format(nls.getString("File.not.found", "File not found: {0}"),
                      new Object[] { servletAndFileName }));
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                  logger.exiting(CLASS_NAME, "setResponseHeaders", "file not found");
          }
  
        return false;
      }
      // PK65384 end
  
      // set the last modified date
      resp.setDateHeader("last-modified", FileModified);
  
      // PK65384 check to ensure ModifiedSince is not -1 before comparing.
      long systemTime  =  System.currentTimeMillis();
      if (ModifiedSince != -1){
           if (ModifiedSince / 1000 == FileModified / 1000) {                  
              resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
                  logger.exiting(CLASS_NAME, "setResponseHeaders", "file not modified");
              }
  
              return false;
           } else if(WCCustomProperties.IFMODIFIEDSINCE_NEWER_THAN_FILEMODIFIED_TIMESTAMP &&
                    (systemTime >= ModifiedSince) && ( ModifiedSince > FileModified )) {
              //RFC2616 :: The requested variant has not been modified
              //   since the time specified in this field, an entity will not be
              //   returned from the server; instead, a 304 (not modified) response will
              //   be returned without any message-body.
              resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);                        
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { 
                  logger.exiting(CLASS_NAME, "setResponseHeaders" ,  "The requested variant has not been modified. ");
              }  
              return false;
           }  
           else if(systemTime < ModifiedSince)
           {
              //RFC2616 :: A date which is later than the server's current time is invalid. 
              // Ignore this conditional and send 200 in response 
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) 
                  logger.logp(Level.FINE, CLASS_NAME, "setResponseHeaders" ,  
                      "The IfModifiedSince date is later than the server's current time so it is invalid, ignore. ");                 
           }                   
      }
      //PM36341 End
      else {
        ServletResponse wasres = ServletUtil.unwrapResponse(resp);                              //709533
        if (!(wasres instanceof IExtendedResponse) || (!((IExtendedResponse) wasres).isOutputWritten())) { //709533
            if (this.getFileSize(true) <= Integer.MAX_VALUE) {    // PM92967                      
                resp.setContentLength(getContentLength());
            }
        }
      }
      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
          logger.exiting(CLASS_NAME, "setResponseHeaders");
      }
      return true;
    }