code: public static boolean isNotModified(@NotNull Resource resource,
        @NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response) throws IOException {
      ResourceModificationDateProvider dateProvider = new ResourceModificationDateProvider(resource);
      return isNotModified(dateProvider, request, response);
    }
docs: Compares the "If-Modified-Since header" of the incoming request with the last modification date of a resource. If
  the resource was not modified since the client retrieved the resource, a 304-redirect is send to the response (and
  the method returns true). If the resource has changed (or the client didn't) supply the "If-Modified-Since" header
  a "Last-Modified" header is set so future requests can be cached.
  <p>
  Expires header is automatically set on author instance, and not set on publish instance.
  </p>
  @param resource the JCR resource the last modification date is taken from
  @param request Request
  @param response Response
  @return true if the method send a 304 redirect, so that the caller shouldn't write any output to the response
  stream
  @throws IOException I/O exception