goja-web/src/main/java/goja/mvc/kits/Servlets.java
public static boolean checkIfModifiedSince(HttpServletRequest request,
                                               HttpServletResponse response,
                                               long lastModified) {
        long ifModifiedSince = request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
        if ((ifModifiedSince != -1) && (lastModified < (ifModifiedSince + 1000))) {
            response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
            return false;
        }
        return true;
    }
public static boolean checkIfModifiedSince(HttpServletRequest request,
                                               HttpServletResponse response,
                                               long lastModified) {
        long ifModifiedSince = request.getDateHeader(HttpHeaders.IF_MODIFIED_SINCE);
        if ((ifModifiedSince != -1) && (lastModified < (ifModifiedSince + 1000))) {
            response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
            return false;
        }
        return true;
    }
public static boolean checkIfModifiedSince ( HttpServletRequest request , HttpServletResponse response , long lastModified ) { long ifModifiedSince = request . getDateHeader ( HttpHeaders . IF_MODIFIED_SINCE ) ; if ( ( ifModifiedSince != - 1 ) && ( lastModified < ( ifModifiedSince + 1000 ) ) ) { response . setStatus ( HttpServletResponse . SC_NOT_MODIFIED ) ; return false ; } return true ; }
根据浏览器If-Modified-Since Header, 计算文件是否已被修改. <p/> 如果无修改, checkIfModify返回false ,设置304 not modify
status.

@param lastModified 内容的最后修改时间.
根据浏览器If - Modified - Since Header 计算文件是否已被修改 . <p / > 如果无修改 checkIfModify返回false 设置304 not modify status .