[MAGNOLIA-2215] initial cache request gets all headers removed Created: 01/Jul/08  Updated: 23/Jan/13  Resolved: 01/Jul/08

Status: Closed
Project: Magnolia
Component/s: cache
Affects Version/s: 3.5.4, 3.5.5, 3.5.6, 3.5.7, 3.5.8
Fix Version/s: 3.5.9

Type: Bug Priority: Blocker
Reporter: Philippe Marschall Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnlia 3.5.8, Tomcat 6.0.16, Java 1.6.0_04-b12


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If a request is made to the cache filter and it's response is not yet cached then all HTTP headers set previously by servlet filters are removed from the response. For all subsequent requests the HTTP headers set by servlet filters are preserved.

We are aware that HTTP headers are not cached but this is a different issue. We explicitly set them in servlet filters for every request including cached ones.

The bug is in the following method in the class info.magnolia.cms.cache.CacheResponseWrapper

    public void resetBuffer() {
        super.reset(); // BUG
        if (cachingStream != null) {
            cachingStream.reset();
        }
        cachingWriter = null;
        status = SC_OK;
    }

The problem is the invocation of the wrong superclass method (reset instead of resetBuffer). This method in invoked by the jsp template renderer when it does a forward.

    public void resetBuffer() {
        super.resetBuffer(); //FIXED
        if (cachingStream != null) {
            cachingStream.reset();
        }
        cachingWriter = null;
        status = SC_OK;
    }


 Comments   
Comment by Magnolia International [ 01/Jul/08 ]

was fixed in trunk since a while but just commited the same fix to the 3.5 branch now.
Thanks.

Generated at Mon Feb 12 03:34:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.