0

I'm using the follow code in .htaccess. It works nicely in localhost, however in production server i'm having troubles with gzip compression.

AddOutputFilterByType DEFLATE text/css text/html application/x-javascript application/javascript <IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
        SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
        SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule>

I contacted my host provider and they told me that mod_deflate is loaded in apache and running. They provide me the following URL to server info. Could you please help me and see if it's in fact loaded? Is this information enough to determine that?

Thanks in advance, Pedro

LINK TO SERVER INFO

Pedro Gil
  • 103
  • 1
  • 3

1 Answers1

0

Pedro -

Apache's mod_deflate and PHP's gzip compression are a bit different. If you want to do it via PHP (which it looks like you can do based on your phpinfo() page, you may want to check out this DevShed article. There's also the option to enable it in your php.ini for all of your PHP scripts automatically:

zlib.output_compression_level = 1

If you want to test to see if mod_deflate is working properly, load up the Live HTTP Headers extension in Firefox and see if the HTTP response from your server contains headers like this one:

Content-Encoding: gzip

My site has it enabled, so you can test against it as a reference.

majorhayden
  • 576
  • 3
  • 5