Rewrite PHP - Double gzip compression

35 views
Skip to first unread message

Matthias Radmüller

unread,
May 9, 2016, 4:25:06 AM5/9/16
to mod-pagespeed-discuss
Hello,

when enabling mod_pagespeed my css/js content served from a php minifier (https://github.com/mrclay/minify) is double gzip compressed.


Matthiass-Mac-Pro:~ mattla93$ curl -I "https://.../template/css/css.php"

HTTP/1.1 200 OK

Date: Mon, 09 May 2016 08:22:40 GMT

Server: Apache

Content-Length: 25901

Expires: Fri, 13 May 2016 19:51:54 GMT

Vary: Accept-Encoding

Last-Modified: Fri, 06 May 2016 19:50:35 GMT

ETag: "pub1462564235;gz"

Cache-Control: max-age=604800

Strict-Transport-Security: max-age=63072000; includeSubdomains; preload

X-Frame-Options: DENY

X-Content-Type-Options: nosniff

X-Original-Content-Length: 25901

X-Content-Type-Options: nosniff

Content-Type: text/css; charset=utf-8


ii  apache2                           2.4.10-10+deb8u4             amd64        Apache HTTP Server

ii  php5-fpm                          5.6.20+dfsg-0+deb8u1         amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)

ii  mod-pagespeed-beta                1.11.33.1-r0                 amd64        Apache 2 module to optimize web content.


I tried with the last stable & with the last pagespeed beta.


When I gunzip the curl response I get the correct output.

This was working bevore, but after a php & apache & mod_pagespeed update I get these problems.


How can I debug / solve this problem?

Joshua Marantz

unread,
May 9, 2016, 8:51:25 AM5/9/16
to mod-pagespeed-discuss
Hi, I am not sure of the specific case with that PHP plugin, but one situation where this can occur is if a plugin upstream of mod_pagespeed gzips content but does not set the gzip header.  mod_pagespeed will then think the response needs more gzipping and gzip it again.

But I have to ask: why do you need both mod_pagespeed and that PHP plugin?  As far as I can tell, mod_pagespeed does everything that plugin does, but should be faster.  Quoting https://github.com/mrclay/minify : "it will probably serve files slower than your HTTPd due to the CGI overhead of PHP", whereas mod_pagespeed is a native C++ Apache module that caches its minified and compressed (gzip -9) output.

-Josh

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/7bcb7755-133a-4f3a-9e8b-45e36b22df4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages