4
votes

When I check this website: http://www.tropicbreeze.co.uk/, for example with http://checkgzipcompression.com/ - it reports that it is using Gzip. But Yslow disagrees.

I have this in my .htaccess file:

AddOutputFilterByType DEFLATE text/html text/php text/x-php application/php  application/x-php  application/x-httpd-php-source text/plain text/xml text/css text/javascript application/x-javascript application/xhtml+xml application/javascript application/x-httpd-php

Checking in the Net tab of Firebug for headers, I can see that the various associated .css and .js files on that page have Content-Encoding gzip appearing as expected - but the php files do not.

Yslow tells me that the homepage is not using Gzip. The Firebug Net tab says that the home page (and other php files on the server) are not being sent with Content-Encoding gzip

I've tried adding all the mimetype filters I could find suggested, and so far as I can see, DEFLATE text/html should cover it anyway, but still no joy.

I have cleared my cache and am not using a proxy.

Can anyone suggest what I've missed? Why are the php files not being gzipped when the other files are? Or, if they are being gzipped, why does Firebug /yslow think they aren't?

1

1 Answers

0
votes

Not sure exactly what the issue might be but perhaps an easy fix would be to try something like...

<IfModule mod_deflate.c>
    <FilesMatch "\.(css|htm|html|js|php|txt|xml)$">
        SetOutputFilter DEFLATE
    </FilesMatch>
</IfModule>

...which should setup compression on popular file extensions including PHP.

I personally think this format is much easier for a human to read too. Bonus!