Request a gzipped response from a web server using Wget

Updated . Posted . Visible to the public.

To reduce download time, application servers usually serve content using gzip compression Show archive.org snapshot , if the browser supports it.

When using a tool like Wget to explicitly download an application's response, the server responds with the uncompressed version:

wget http://example.com/

If you are curious about the compressed file's size, pass the corresponding HTTP header:

wget --header="accept-encoding: gzip" http://example.com/
Arne Hartherz
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2011-12-05 13:24)