public static boolean doCacheHeaderValidation(final SolrQueryRequest solrReq,final HttpServletRequest req,final Method reqMethod,final HttpServletResponse resp){
  if (Method.POST == reqMethod || Method.OTHER == reqMethod) {
    return false;
  }
  final long lastMod=HttpCacheHeaderUtil.calcLastModified(solrReq);
  final String etag=HttpCacheHeaderUtil.calcEtag(solrReq);
  resp.setDateHeader("Last-Modified",lastMod);
  resp.setHeader("ETag",etag);
  if (checkETagValidators(req,resp,reqMethod,etag)) {
    return true;
  }
  if (checkLastModValidators(req,resp,lastMod)) {
    return true;
  }
  return false;
}

public static boolean doCacheHeaderValidation ( final SolrQueryRequest solrReq , final HttpServletRequest req , final Method reqMethod , final HttpServletResponse resp ) { if ( Method . POST == reqMethod || Method . OTHER == reqMethod ) { return false ; } final long lastMod = HttpCacheHeaderUtil . calcLastModified ( solrReq ) ; final String etag = HttpCacheHeaderUtil . calcEtag ( solrReq ) ; resp . setDateHeader ( "Last-Modified" , lastMod ) ; resp . setHeader ( "ETag" , etag ) ; if ( checkETagValidators ( req , resp , reqMethod , etag ) ) { return true ; } if ( checkLastModValidators ( req , resp , lastMod ) ) { return true ; } return false ; }
sets http response cache validator headers appropriately and validates the http request against these using any conditional request headers . if the request contains conditional headers , and those headers indicate a match with the current known state of the system , this method will return " true " indicating that a 304 status code can be returned , and no further processing is needed .
