How to check if Apache compression is working?

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.


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.


for simple way, you can use google chrome, open menu Tools > Developer Tools then look at this image enter image description here

if you DISABLE the compression, you won't see that gzip text

hope it helps


Fiddler2 can help with this. Fire it up and look at the Inspector. It can also tell you what file sizes you're looking at. Additionally, you can set it to decode automatically if you are running into compression-related problems with your browser.

Note: this answer is now CW--please update with more info if you wish (I don't have time right now!)