gzip encoding with curl

Written by
Date: 2012-12-23 15:27:32 00:00

If you want to see if your Nginx or Apache server are sending you gzip content, and the appropriate headers, you can use curl

curl -I -H 'Accept-Encoding: gzip,deflate' http://www.garron.me/

You should see something like:

HTTP/1.1 200 OK
Date: Sun, 23 Dec 2012 19:31:42 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Sun, 23 Dec 2012 19:05:31 GMT
ETag: "da6aa-1b68-4d189c3b534c0"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Cache-Control: max-age=7200, must-revalidate
Content-Length: 2561
Content-Type: text/html

Check for this Vary: Accept-Encoding and this Content-Encoding: gzip. That means your server is sending gzipped content.