Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2215

initial cache request gets all headers removed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 3.5.9
    • 3.5.4, 3.5.5, 3.5.6, 3.5.7, 3.5.8
    • cache
    • None
    • Magnlia 3.5.8, Tomcat 6.0.16, Java 1.6.0_04-b12

    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;
          }
      

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              gjoseph Magnolia International
              pmm Philippe Marschall
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD