Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Title: Enabling cache.gzip in Grav 2.0 broke my site, two Content-Encoding headers at once?

Started by slutsteg 3 days ago · 1 replies · 93 views
3 days ago

When I enable gzip (Cache settings) in the Admin panel, my site starts showing strange/garbled characters instead of the page in some browsers. Turning it off makes the site work again but then my HTML isn’t compressed at all.

My setup:

TXT
•Grav 2.0.8 with Admin 2.0.12

•Shared hosting: nginx proxy in front of Apache (mod_deflate active)

•PHP 8.4.21

•Theme is custom, no special plugins touching output

The one clue I found: with gzip enabled, the response has two Content-Encoding headers at the same time

content-encoding: identity

content-encoding: gzip

which browsers apparently can’t decode. It looks like Grav sends the identity header itself and Apache adds the gzip one on top.

Is this a known issue? What’s the correct way to get compressed pages on an Apache/mod_deflate host , should gzip in Admin be off and something else configured instead? Any pointers appreciated.

3 days ago

If you already have gzip or deflate enabled on your webserver, or even if it's enabled through cloudflare or something, you don't need to force it on in Grav. It's really only useful if your webserver (or cloudflare and similar) are not doing any kind of compression for you. So this is normal. Grav itself can't really tell what happens after it sends the content.

Suggested topics

Topic Participants Replies Views Activity
Support · by BenLaKnet, 5 days ago
1 118 2 days ago
Support · by BenLaKnet, 1 week ago
5 194 2 days ago
Support · by kskt, 2 days ago
0 42 2 days ago
Support · by David Meissner, 2 days ago
0 39 2 days ago
Support · by David Meissner, 3 days ago
3 88 3 days ago