Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Story Points:
      4
    • Fix Priority:
      3
    • Similar Issues:
      Show 5 results 

      Description

      ServletResponseUtil will override the Cache-Control header, no matter what was set before. In this particular case, when trying to modify the header using the HeaderFilter will fail because the portal will override it with a hard-coded value later on.

        Activity

        Hide
        Sharry Shi added a comment -

        PASSED Manual Testing using the following steps:

        1. Start the portal.
        2. Upload an image to the D&M under Control Panel.
        3. Use the "Get URL" button in order to get a direct link to the image. (something like: http://localhost:8080/documents/10179/0/liferay-logo.jpg/3f0048e5-3126-4b92-bcde-8bca08c887ff?t=1366634847000)
        4. Open a browser making sure that no cache is triggered when loading the page and having the network tools enables.
        5. Past the link from step 3 and check the response header. This should have "Cache-Control: private"
        6. Shut down the portal.
        7. Edit the <tomcat_home>/webapps/ROOT/WEB-INF/liferay-web.xml
        8. Add the following filter mapping:
              <filter-mapping>
                  <filter-name>Header Filter</filter-name>
                  <url-pattern>/documents/*</url-pattern>
              </filter-mapping>
          I've added it right after the following block:
              <filter-mapping>
                  <filter-name>Header Filter</filter-name>
                  <url-pattern>*.png</url-pattern>
              </filter-mapping>
        9. Start the portal again.
        10. Open a browser making sure that no cache is triggered when loading the page and having the network tools enables.
        11. Paste the link from step 3 and check the response header.

        Reproduced on:
        Tomcat 7.0 + MySQL 5. Portal 6.1.1 CE GA2.

        The Cache-Control shows like "cache-control: private no matter if the header filter is involved or not.

        Fixed on:
        Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 85afde1d20a30c455bdbb06cea00787c023f71ae.
        Tomcat 7.0 + MySQL 5. Portal 6.1.x.EE GIT ID: c5c246c544de3327b18bb9872caad76805eb5852.

        The Cache-Control header have the values set according to the Header Filter settings, in my case was "Cache-Control: max-age=315360000, public".

        Show
        Sharry Shi added a comment - PASSED Manual Testing using the following steps: Start the portal. Upload an image to the D&M under Control Panel. Use the "Get URL" button in order to get a direct link to the image. (something like: http://localhost:8080/documents/10179/0/liferay-logo.jpg/3f0048e5-3126-4b92-bcde-8bca08c887ff?t=1366634847000 ) Open a browser making sure that no cache is triggered when loading the page and having the network tools enables. Past the link from step 3 and check the response header. This should have "Cache-Control: private" Shut down the portal. Edit the <tomcat_home>/webapps/ROOT/WEB-INF/liferay-web.xml Add the following filter mapping: <filter-mapping> <filter-name>Header Filter</filter-name> <url-pattern>/documents/*</url-pattern> </filter-mapping> I've added it right after the following block: <filter-mapping> <filter-name>Header Filter</filter-name> <url-pattern>*.png</url-pattern> </filter-mapping> Start the portal again. Open a browser making sure that no cache is triggered when loading the page and having the network tools enables. Paste the link from step 3 and check the response header. Reproduced on: Tomcat 7.0 + MySQL 5. Portal 6.1.1 CE GA2. The Cache-Control shows like "cache-control: private no matter if the header filter is involved or not. Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 85afde1d20a30c455bdbb06cea00787c023f71ae. Tomcat 7.0 + MySQL 5. Portal 6.1.x.EE GIT ID: c5c246c544de3327b18bb9872caad76805eb5852. The Cache-Control header have the values set according to the Header Filter settings, in my case was "Cache-Control: max-age=315360000, public".

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 43 weeks, 6 days ago

              Development

                Structure Helper Panel