I'm having some trouble with mod_deflate… Specifically, that it's not actually deflating anything.

I'm running Apache2 and Debian 4. I've a2enmod deflate'd, and put this in /etc/apache2/mods-enabled/deflate.conf:

AddOutputFilterByType DEFLATE text/html text/plain

Yet, when I curl -I http://host/robots.txt, I don't see any headers suggesting the output is being deflated (and this suspicion is confirmed when I tail access.log, and see that my DeflateFilterNote in the logs is -). I know that "it's plugged in", because if I add:

SetEnv force-gzip "yes"

The output is compressed.

So, am I doing something obvious and stupid wrong? Or… What?

link|improve this question

64% accept rate
feedback

1 Answer

up vote 5 down vote accepted

mod_deflate won't send compressed output unless the client indicates that it supports it. The client does this by sending a header of Accept-Encoding: gzip in the original request.

curl doesn't do this by default. But you can instruct it to do so with the command:

curl --compressed -I http://host/robots.txt
link|improve this answer
D'oh! Thanks. I was mistaking curl's Accept: */* for Accept-encoding. Clearly tinkering with HTTP is the wrong thing to do first-thing monday morning… – David Wolever Oct 19 '09 at 13:41
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.