code: private boolean passConditionalHeaders(HttpRequest request,
                                             HttpResponse response,
                                             Resource resource)
          throws IOException
      {
          if (!request.getMethod().equals(HttpRequest.__HEAD))
          {
              // If we have meta data for the file
              // Try a direct match for most common requests. Avoids
              // parsing the date.
              ResourceCache.ResourceMetaData metaData =
                  (ResourceCache.ResourceMetaData)resource.getAssociate();
              if (metaData!=null)
              {
                  String ifms=request.getField(HttpFields.__IfModifiedSince);
                  String mdlm=metaData.getLastModified();
                  if (ifms!=null && mdlm!=null && ifms.equals(mdlm))
                  {
                      response.setStatus(HttpResponse.__304_Not_Modified);
                      request.setHandled(true);
                      return false;
                  }
              }
  
              
              long date=0;
              // Parse the if[un]modified dates and compare to resource
              
              if ((date=request.getDateField(HttpFields.__IfUnmodifiedSince))>0)
              {
                  if (resource.lastModified()/1000 > date/1000)
                  {
                      response.sendError(HttpResponse.__412_Precondition_Failed);
                      return false;
                  }
              }
              
              if ((date=request.getDateField(HttpFields.__IfModifiedSince))>0)
              {
                  
                  if (resource.lastModified()/1000 <= date/1000)
                  {
                      response.setStatus(HttpResponse.__304_Not_Modified);
                      request.setHandled(true);
                      return false;
                  }
              }
     
          }
          return true;
      }
docs: /* Check modification date headers.