fix(prod): stop garbage page from double Content-Encoding header
On this non-FastCGI host Grav's shutdown early-connection-close can't fastcgi_finish_request(), so it emits 'Content-Encoding: identity' to ask the webserver not to compress — but Apache mod_deflate compresses anyway and adds 'Content-Encoding: gzip'. Two conflicting headers => browsers render raw gzip bytes (garbage page). Surfaced when prod flipped to debug:false today (activated Grav's full output path). Fix in the prod env override: debugger.shutdown.close_connection:false skips the identity-header path so mod_deflate compresses cleanly (single header). Verified: one 'content-encoding: gzip', page renders correctly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Np4cMQLF77i664CAQXySzU
This commit is contained in:
Vendored
+18
@@ -18,3 +18,21 @@ twig:
|
||||
cache: true
|
||||
debug: false
|
||||
auto_reload: false
|
||||
|
||||
# Compression / connection handling.
|
||||
#
|
||||
# This host is not FastCGI (no fastcgi_finish_request()), so Grav's shutdown
|
||||
# "early connection close" falls back to emitting `Content-Encoding: identity`
|
||||
# to ask the webserver not to compress. But Apache's mod_deflate compresses
|
||||
# anyway and adds `Content-Encoding: gzip`, giving TWO conflicting headers —
|
||||
# the browser can't decode the body and renders raw gzip bytes (a garbage
|
||||
# page). Note: allow_webserver_gzip:true takes the SAME identity branch, so it
|
||||
# does not help. The real fix is to disable the early-close path, so Grav never
|
||||
# emits the bogus header and mod_deflate compresses cleanly (single header).
|
||||
debugger:
|
||||
shutdown:
|
||||
close_connection: false
|
||||
# Let the webserver own gzip; Grav does not compress or double-label.
|
||||
cache:
|
||||
gzip: false
|
||||
allow_webserver_gzip: false
|
||||
|
||||
Reference in New Issue
Block a user