Skip to content

Response compression: send Vary: Accept-Encoding on uncompressed responses too #1265

Open

Description

@rmcdaniel

Found while qualifying 3.17.0 for Cloud (cloud#875). Native response compression (#1261) adds Vary: Accept-Encoding only to responses it compressed.

A shared cache could then store an identity response, which has no Vary header, and serve it to a client that asked for gzip, or the reverse after a compressed response.

Impact today: none. Cloudflare treats these API responses as DYNAMIC and doesn't cache them.

Fix: add Vary: Accept-Encoding to every response that could be compressed (eligible content type, size above the threshold), whether or not this request was. Test both paths.

Done when both paths carry the header and a test covers them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions