Gzip - anyone?


#1

I wasn’t allowed to edit the last post. So let me rephrase. I have some css and js, xml, etc, that are text files. I want them automatically compressed and sent out over the web.

I tested the following:

http://tulipamusic.com/scripts/jscript/main.js

using the page:

http://whatsmyip.org/mod_gzip_test/

What it said was:

http://tulipamusic.com/scripts/jscript/main.js is not gzipped”

I included an htaccess file in the jscript directory. It was supposed to tell Apache to zip it up. It has the single line:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/x-js

It didn’t work. How does one make it so that this, or other text files in other directories are automatically compressed before being sent out over the web?


#2

I guess since no one seems to know, some might like to know the answers I got on my own. It might be helpful. (maybe not?)

First, the .htaccess can be in the script’s directory, or any parent directory. Apache looks for it. So I place .htaccess in my root directory.

Second, the addfilter does work. Dreamhost is just using something else as the CONTENT-TYPE specification for javascript. It’s not using text/x-js. It’s using “application/javascript”.

So this works:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript

Other methods worked, as well.

The problem now is that the server seems to be sending the data back - chunked. I’ve read that this is auto-behavior for files over 50K, or something. But it’s even sending 46K javascript files back chunked. And while I have graphics that should take longer, oddly the real wait and tie-up in delivering the site really is the javascript file. It may even be gzipped as part of the ‘chunking’. I don’t know how it works. But somehow, it’s just slow.