Forum Moderators: phranque

Message Too Old, No Replies

mod_gzip compressing HTML files, but nothing else

I thought it was supposed to compress everything

         

MatthewHSE

3:21 am on Dec 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Awhile back, I had my host install mod_gzip on my server. It made a difference on my HTML pages, but it's not compressing my CSS or JS files at all. Also, it's not compressing any pages generated by my .cgi scripts, which are the majority of my site.

I thought mod_gzip was supposed to compress everything but images before it got sent to the browser. Since that's not currently the case with my site, what can I tell my host to see if things can be "tweaked" to include everything in the compression?

Also, how can I verify what is being compressed and what's not? I've been using the Speed Check at websiteoptimization.com, but I'm not sure it's giving accurate "yes/no" information about all files that could be compressed.

Thanks,

Matthew

amznVibe

3:29 am on Dec 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By default mod_gzip doesn't gzip everything. You have to add directives in your .HTACCESS file but sometimes you cannot override what is set higher up on a virtual host.

[schroepl.net...]

You need to add lines like this (won't work if its not 1.3.26)

mod_gzip_handle_methods GET POST

mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
mod_gzip_item_exclude mime ^image/.*$

mod_gzip_item_include file \.js$
mod_gzip_item_include file \.css$
mod_gzip_item_include file \.pl$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/plain$
mod_gzip_item_include mime ^httpd/unix-directory$