Fetching GZipped Web Server Contents: How to get what your web server is really sending.
curl -H 'Accept-Encoding: gzip,deflate' -o saved.gz http://myserver.com/somepage
The above will fetch the gzipped content directly from the server and write it to
If all you want to do is ensure that your web server’s gzip settings are working at all, then you can just:
curl -I -H 'Accept-Encoding: gzip,deflate' http://myserver.com/somepage
If you see either of the following lines in the output, all is well:
Content-Encoding: gzip Content-Encoding: deflate
If you don’t see those, no gzipping is happening, and you’re wasting your server bandwidth and your client’s time transmitting your HTML in plain text.