3

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?

David Wolever
  • 2,237
  • 3
  • 23
  • 27

1 Answers1

5

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
Dan Carley
  • 25,189
  • 5
  • 52
  • 70
  • 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