DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33319>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33319

           Summary: [PATCH] Fix issue with ResourceReader returning non-
                    cacheable content if expires not explicitly provided
           Product: Cocoon 2
           Version: Current SVN 2.1
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: core
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: [EMAIL PROTECTED]


The way ResourceReader is currently implemented it will set a 'Vary' response 
header if the 'expires' parameter is not provided.

IE will not cache responses containing this header, with one exception when 
the header value is the 'User-Agent' field, for more detail see:
http://lists.over.net/pipermail/mod_gzip/2002-December/006826.html
 
Looking at the ResourceReader source and the associated bug report, setting 
the 'Vary' header was intended to prevent IE from
caching the resource when the 'expires' parameter was provided with a value of 
0.  The way the code is implemented the header will also be set when the 
expires parameter is not provided.

Patch is provided below:

Index: org/apache/cocoon/reading/ResourceReader.java
===================================================================
--- org/apache/cocoon/reading/ResourceReader.java       (revision 149197)
+++ org/apache/cocoon/reading/ResourceReader.java       (working copy)
@@ -302,7 +302,7 @@
         try {
             if (expires > 0) {
                 response.setDateHeader("Expires", System.currentTimeMillis() 
+ expires);
-            } else {
+            } else if(expires == 0) {
                 // See Bug #14048
                 response.addHeader("Vary", "Host");
             }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to