Forum Moderators: phranque

Message Too Old, No Replies

Problems with Defalt / Mod gzip

         

kabbink

9:13 am on Jan 14, 2009 (gmt 0)

10+ Year Member



Hey guys,

My host uses Apache 2.2.10 so I think I need to use mod_deflate to compress all my files.

In phpinfo() I have:
_SERVER["HTTP_ACCEPT_ENCODING"]gzip,deflate

so it looks like the modules are enabled.

in my .htaccess in the public_html directory I have

# Compress output
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

When I load up my site with [websiteoptimization.com...]
it shows that the main file index.php is being compressed but says that the css file and a bunch of js files remain uncompressed.

Theses files are of course hosted on my server but are not in the root directory. For instance the .css file is in public_html/images/main.css

Is there something extra I should be doing to get it to compress the css file?

jdMorgan

5:52 pm on Jan 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suggest that you use a browser plug-in to view your server headers, rather than relying on a Web-based tool to do it. This eliminates any possible shortcomings or bugs in the Web-based tool. I use and recommend the "Live HTTP Headers" add-on for Firefox and Mozilla-based browsers as part of the basic Webmaster toolkit.

AddFilterByType only "cares" about the filetype (the physical file's extension). It does not care about the requested URL, the directory path to the file, or the file's name, it only cares about its extension. Therefore, your .css files should be getting compressed if the client indicates that it can accept gzip compression on .css files.

Jim