private void setDateAndCacheHeaders(HttpResponse response, File fileToCache) {
        response.headers().set(HttpConst.DATE, DateKit.gmtDate());
        // Add cache headers
        if (httpCacheSeconds > 0) {
            response.headers().set(HttpConst.EXPIRES, DateKit.gmtDate(LocalDateTime.now().plusSeconds(httpCacheSeconds)));
            response.headers().set(HttpConst.CACHE_CONTROL, "private, max-age=" + httpCacheSeconds);
            if (null != fileToCache) {
                response.headers().set(HttpConst.LAST_MODIFIED, DateKit.gmtDate(new Date(fileToCache.lastModified())));
            } else {
                response.headers().set(HttpConst.LAST_MODIFIED, DateKit.gmtDate(LocalDateTime.now().plusDays(-1)));
            }
        }
    }
private void setDateAndCacheHeaders ( HttpResponse response , File fileToCache ) { response . headers ( ) . set ( HttpConst . DATE , DateKit . gmtDate ( ) ) ; if ( httpCacheSeconds > 0 ) { response . headers ( ) . set ( HttpConst . EXPIRES , DateKit . gmtDate ( LocalDateTime . now ( ) . plusSeconds ( httpCacheSeconds ) ) ) ; response . headers ( ) . set ( HttpConst . CACHE_CONTROL , "private, max-age=" + httpCacheSeconds ) ; if ( null != fileToCache ) { response . headers ( ) . set ( HttpConst . LAST_MODIFIED , DateKit . gmtDate ( new Date ( fileToCache . lastModified ( ) ) ) ) ; } else { response . headers ( ) . set ( HttpConst . LAST_MODIFIED , DateKit . gmtDate ( LocalDateTime . now ( ) . plusDays ( - 1 ) ) ) ; } } }
Sets the Date and Cache headers for the HTTP Response

@param response    HTTP response
@param fileToCache file to extract content type