Opened 2 hours ago

Last modified 2 hours ago

#36688 assigned Bug

GzipMiddleware adds 'Vary: Accept-Encoding' unnecessarily

Reported by: Adam Johnson Owned by: Adam Johnson
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

GZipMiddleware has an early-return path when the compressed content is longer than the original, to save bandwidth. Unfortunately, in this case, it still adds Vary: Accept-Encoding, slightly degrading HTTP cache performance.

The fix is to move the patch_vary_headers() call later.

Change History (1)

comment:1 by Adam Johnson, 2 hours ago

Wait, on second thought, I might be wrong. Just because on a given run of a view, we couldn't compress the content, doesn't mean we won't be able to in another run.. not sure on HTTP semantics actually.

Note: See TracTickets for help on using tickets.
Back to Top