Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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