How do you know if the HTTP Compression setup is working? Is there any tool I can use to see the compressed page before it is uncompressed by the browser? are there any tools to measure the amount compressed and response speed?
You can use this website: http://whatsmyip.org/mod_gzip_test/
For Windows, I highly recommend Fiddler, which is a client-side tool that proxies your web traffic and lets you examine it. It will show you if compression is on and working. It is also useful for many other client-side HTTP-related debugging and diagnosis tasks.
Use Fiddler to spy on your HTTP transmissions.
"Build Request" (create an HTTP GET) and check the "Content-Encoding" header of the HTTP response for your uncompressed page, and check its "Content-Length". Compare those to the same values for your compressed page.
"Content-Encoding" should be something like "gzip" for compressed responses, and your "Content-Length" should be shorter. You can use the "Content-Length" fields from both to determine the compression ratio.
Wireshark, former Etherial has proved to be the most valuable tool for me.
Just choose a network adapter (if there are many), type "tcp port 80" into the filter field, press Capture - and you're all set.
If you want to go really low tech, you can telnet to the http port (80?) on the target server and type in the request manually. If you get plain text back, then it's not gzipped, but if you get gibberish then you're onto something. If you need to see the structure of the headers you can copy them from Firefox using something like the livehttpheaders extension.
For Firefox have a look at these add-ons:
- Firebug
- HttpFox
Both can be used to monitor your traffic to/from the browser (You can see the size of each response). I especially like Httpfox, a really nice add-on I use everyday.
As well as something like Fiddler to look at the HTTP-level traffic, you can use Firefox with the Firebug and YSlow add-ons. YSlow gives you a lot of useful analysis about why your page might be slow - among these, it gives you the size of the various assets that your request downloads (HTML, CSS, JavaScript, images and other media etc). You can compare the size of pages with and without compression - if the HTML is smaller with the compression turned on, you know it's working. It will also give you values with an empty cache and a primed cache, allowing you to see how much you're saving for both new visitors and returning visitors.