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?
mod_deflate
won't send compressed output unless the client indicates that it supports it. The client does this by sending a header ofAccept-Encoding: gzip
in the original request.curl
doesn't do this by default. But you can instruct it to do so with the command: