How to check if Apache compression is working

apache-2.2compressionconfiguration

I just added the following to my Apache config file:

AddOutputFilterByType DEFLATE text/html text/plain text/xml

How do I check if it is actually working? Nothing on the browser tells me if the page contains gzipped content.

Best Answer

An alternative way to quickly check the headers of the HTTP response would be to use curl.

For instance, if the Content-Encoding header is present in the response, then mod_deflate works:

$ curl -I -H 'Accept-Encoding: gzip,deflate' http://www.example.org/index.php
[...]
Content-Encoding: gzip
[...]

If you run the above command without the -H 'Accept-Encoding: gzip,deflate' part, which implies that your HTTP client does not support reading compressed content, then Content-Encoding header will not be present in the response.

Hope this helps.