difficult problem with double "Content-Encoding: gzip" "Content-Encoding: gzip"
-
Using WP 4.1 and wp-super-cache 1.4.2
I am having a difficult problem eliminating a special case of double encoding by nginx of supercache’s already gzipped output when legacy cache files are served.
Most modern browsers figure out this problem and properly double decode the situation but Safari does not.
I am able to reproduce this problem consistently on mobile safari and the last Windows desktop Safari 5
Basically take any logged out user and they will see regular wordpress posts fine.
Then add a query string to any post url the the problem will happen.
example.com/blah-blah?abc=123
Content-Type text/html; charset=UTF-8 Transfer-Encoding chunked Connection keep-alive Content-Encoding gzip Content-Encoding gzip Vary Accept-Encoding, Cookie WP-Super-Cache Served legacy cache fileNote you need a special header viewer to see the double gzip header because some browsers will merge them entirely or show
gzip, gzipinstead.What is happening is wp-super-cache is dumping the raw gzipped cache file though PHP and adding a content-encoding header but then NGINX is also configured to GZIP all output from PHP backend.
So it gets double gzipped.
One harsh way to fix this would be to disable all gzip in wp-super-cache which I do not want to do, since nginx can easily serve the already gzipped files.
I’ve researched nginx and there does not appear to be any way to disable the gzip if the backend already has a header set.
Which means the problem has to be fixed inside the plugin, somewhere in phase1 or phase2
Thanks for any help
The topic ‘difficult problem with double "Content-Encoding: gzip" "Content-Encoding: gzip"’ is closed to new replies.