Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25204

If "index_page" option is set, HTTP cache does not work properly

    XMLWordPrintable

    Details

      Description

      It has been verified that when using the "index_page" setting, the home page is not delivered with Vary on X-User-Hash but with Vary on cookie. This means for each user a different home page will be generated and cached, which is highly inefficient. Vary on X-User-Hash would be correct (which means: cache the page for each user having the same roles).

      Steps to reproduce:

      1. Prepare a new eZ Publish 5.4 installation, fully updated to the latest version, 5.4.5;
      2. Use the following configuration on ezpublish.yml:

      ezpublish:
          system:
              ...
              eng:
                  languages:
                      - eng-GB
                  session:
                      name: eZSESSID
                  index_page: /content/location/61
      

      3. Edit vhost file, and make sure http_cahing is enabled i.e. is using the default "SetEnv USE_HTTP_CACHE 1";
      4. Call the page (http://54ezdemo.com/eng) and check http-headers (for the first time loading):

      Age:6
      Cache-Control:public, s-maxage=60
      Connection:Keep-Alive
      Content-Encoding:gzip
      Content-Length:6412
      Content-Type:text/html; charset=UTF-8
      Date:Fri, 04 Dec 2015 17:39:42 GMT
      Keep-Alive:timeout=5, max=100
      Server:Apache/2.4.16 (Ubuntu)
      Set-Cookie:eZSESSID=0k8je2vckcbi544h39nasv4c54; path=/
      Vary:Cookie,Accept-Encoding,Authorization,X-User-Hash
      X-Content-Digest:ezlocation/61/enc60b0589fd5ec39fd6bbdc8f9d6ed3f72edc23cf973182b6d2de620a69556968
      X-Location-Id:61
      

      Notice the "Vary" header is "Vary:Cookie,Accept-Encoding,Authorization,X-User-Hash". When "index_page" is not used, the vary header is "Vary:X-User-Hash,Accept-Encoding", which is correct.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            nuno.oliveira-obsolete@ez.no Nuno Oliveira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: