Uploaded image for project: 'eZ Platform Enterprise Edition'
  1. eZ Platform Enterprise Edition
  2. EZEE-2898

ESI fragments not rendered via Fastly if GZIP is enabled

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • Customer request
    • 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5
    • eZ Platform Cloud
    • None

    Description

      We have stumbled upon an issue when trying to run eZ Platform EE 2.5 on Platform.sh, in production environment.

      We are using ezsystems/ezplatform-http-cache-fastly v1.1.3 on our website, and the default VCL files provided in the bundle.

      When we try to render any controller on the website with the render_esi method, it will never get rendered. Instead, esi:include tag will remain in the DOM and the subrequest will not get processed, as if the Surrogate capability is not enabled.

      Looks like the problem happens because Fastly does not support ESI rendering if the GZIP is enabled.

      By default, the Platform.sh should not use gzip compression:

      https://docs.platform.sh/configuration/app-containers.html 

      But then again, this can be modified if needed, and the Fastly CDN can also be used on other environments besides Platform.sh, so this should be taken into consideration:

      https://support.fastly.com/hc/en-us/community/posts/360040168131-Conditionally-Disabling-GZIP-in-Order-to-Serve-ESI

      The solution is to unset the accept-encoding header in the vcl_miss sub-routine. This should ensure that when you serve the ESI, the contents remain uncompressed:

      sub vcl_miss{ 
          #FASTLY miss 
          unset bereq.http.accept-encoding;
          return(fetch);
      }

      If this should not be added in the default main.vcl, I think this should at least be documented in the README file, might be a significant time-saver.

      Attachments

        Activity

          People

            vidar.langseid@ibexa.co Vidar Langseid
            fc262394-a899-48af-9188-9148599aa871@accounts.ibexa.co Hrvoje Knežević
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: