Remove mod_deflate and ETag stripping to fix CDN 404s#1634
Open
davsclaus wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mod_deflatecompression section (~200 lines) from.htaccessWhy
The sporadic 404 errors (#1631, #1565, INFRA-27679) are correlated with
Accept-Encoding: gzip— browsers get 404s but curl (which doesn't send gzip by default) works fine.mod_deflate removal: The
.htaccesshad Apache'smod_deflatehandling compression on the origin, including a decade-old workaround for "mangled Accept-Encoding" headers. With Fastly CDN in front, the CDN handles compression — having Apache also do it can interfere with Fastly'sVary: Accept-Encodingcache key handling, contributing to the gzip-specific 404s. The removed sections include:SetEnvIfNoCaseworkaround for mangled encoding headersAddOutputFilterByType DEFLATEfor all MIME typesAddEncoding gzip svgzETag removal: The
.htaccesswas stripping ETags (Header unset ETag+FileETag None). ETags are actually useful for Fastly's cache validation — removing them forces full re-fetches on every cache miss instead of efficient 304 Not Modified responses.Test plan
Content-Encoding: gzipis still present in responses (handled by Fastly)Accept-Encoding: gziprequests.svgzfiles still render correctly (Fastly should handle the encoding)Fixes #1631