code: private boolean browserHasNewestVersion(HttpServletRequest request, long resourceLastModifiedTimestamp) {
  
          if (resourceLastModifiedTimestamp < 1) {
              // We do not know when it was modified so the browser cannot have an
              // up-to-date version
              return false;
          }
          /*
           * The browser can request the resource conditionally using an
           * If-Modified-Since header. Check this against the last modification
           * time.
           */
          try {
              // If-Modified-Since represents the timestamp of the version cached
              // in the browser
              long headerIfModifiedSince = request.getDateHeader("If-Modified-Since");
  
              if (headerIfModifiedSince >= resourceLastModifiedTimestamp) {
                  // Browser has this an up-to-date version of the resource
                  return true;
              }
          } catch (Exception e) {
              // Failed to parse header. Fail silently - the browser does not have
              // an up-to-date version in its cache.
          }
          return false;
      }
docs: Checks if the browser has an up to date cached version of requested
  resource. Currently the check is performed using the "If-Modified-Since"
  header. Could be expanded if needed.<p>
  
  @param request the HttpServletRequest from the browser
  @param resourceLastModifiedTimestamp the timestamp when the resource was last modified. 0 if the last modification time is unknown
  
  @return true if the If-Modified-Since header tells the cached version in the browser is up to date, false otherwise