code: public static void setDateLastModifiedHeader(HttpServletResponse res, long dateLastModified) {
  
          if (dateLastModified > -1) {
              // set date last modified header (precision is only second, not millisecond
              res.setDateHeader(CmsRequestUtil.HEADER_LAST_MODIFIED, (dateLastModified / 1000) * 1000);
          } else {
              // this resource can not be optimized for "last modified", use current time as header
              res.setDateHeader(CmsRequestUtil.HEADER_LAST_MODIFIED, System.currentTimeMillis());
              // avoiding issues with IE8+
              res.addHeader(CmsRequestUtil.HEADER_CACHE_CONTROL, "public, max-age=0");
          }
      }
docs: Sets the "last modified" date header for a given http request.<p>
  
  @param res the response to set the "last modified" date header for
  @param dateLastModified the date to set (if this is lower then 0, the current time is set)