1. opensymphony
  2. oscache

Commits

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

Only send last modified header if the response isn't a fragment of page
Submitted by: Lars Torunski

  • Participants
  • Parent commits a13b744
  • Branches default

Comments (0)

Files changed (1)

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

View file
  • Ignore whitespace
         result = new ResponseContent();
         this.fragment = fragment;
         
-        // setting a default last modified value based on object creation and remove the millis
-        long current = System.currentTimeMillis() / 1000;
-        result.setLastModified(current * 1000);
-        super.setDateHeader(CacheFilter.HEADER_LAST_MODIFIED, result.getLastModified());
+        // only set the last modified value, if a complete page is cached
+        if (!fragment) {
+            // setting a default last modified value based on object creation and remove the millis
+            long current = System.currentTimeMillis() / 1000;
+            result.setLastModified(current * 1000);
+            super.setDateHeader(CacheFilter.HEADER_LAST_MODIFIED, result.getLastModified());
+        }
     }
 
     /**