1. opensymphony
  2. oscache

Commits

ltor...@81dbac14-341a-0410-aa85-cbcd92e6f43e  committed bb827db

CACHE-116: don't send the last modified header "Wed, 31 Dec 1969 23:59:59 GMT" , if no header is set.

  • Participants
  • Parent commits 1cbf78f
  • Branches v2_1_1

Comments (0)

Files changed (1)

File src/core/java/com/opensymphony/oscache/web/filter/ResponseContent.java

View file
  • Ignore whitespace
     private String contentType = null;
     private String contentEncoding = null;
     private byte[] content = null;
-    // setting a default last modified value based on object creation
-    private long lastModified = System.currentTimeMillis();
+    private long lastModified = -1;
 
     /**
      * Set the content type. We capture this so that when we serve this
             response.setContentType(contentType);
         }
 
-        if (response instanceof HttpServletResponse) {
+        if ((lastModified != -1) && (response instanceof HttpServletResponse)) {
             ((HttpServletResponse) response).setDateHeader(CacheFilter.HEADER_LAST_MODIFIED, lastModified);
         }
 
         response.setContentLength(content.length);
 
+
         if (locale != null) {
             response.setLocale(locale);
         }