Gzip only working on html - not css or javascript

I’m completely stumped on this one.

I have this in .htacess

# Enable GZIP
php_value output_handler ob_gzhandler
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
Header append Vary Accept-Encoding
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\\.0[678] no-gzip
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html
</ifmodule>

but css and js files are not being compressed. Why is that?

Thanks David,

Any chance you could be a bit more specific when you say it’s to do with the specification of the /html file type?

On the second point are you talking about <ifmodule mod_deflate.c>?

I have no idea what a webmaster is and have never described myself as one, sorry.

pal,

It seems as though you DO have text/css included in your file types and have attempted to include javascript files with application/javascript (but I’m not sure that one is correct). I’m in the middle of computer upgrading so I’m not able to check my own setup.

Yes, the <IfModule>…</IfModule> is terribly wasteful of Apache resources. If I found someone in one of my hosting accounts using that, I’d remove the wrapper and warn them to view their phpinfo() scripts to determine whether it’s enabled or not. If I found it again, they’d be removed from my (VPS) server. If you make the test once (without the wrapper) and don’t get a 500 error, it’s enabled.

Regards,

DK

pal,

It probably has to do with the specification of the /html file type.

BTW, if you don’t know whether you have that module installed or not, hang up your webmaster hat! You’re making Apache test that for EVERY file request which is an abuse of your server!

Regards,

DK