How to Check If Web Server Supports Gzip

Objective: Check if web server supports the serving of gzipped content.

We can use curl to test if a apache or nginx web server is configured to server gzipped content. The "Accept-Encoding: gzip,deflate" request header is used to inform the server that the client accepts gzip encoding. If the server supports gzip encoding and if response header from the web server indicates “Content-Encoding: gzip”, then the content is gzipped.

If you are only interested in the “Accept-Encoding” and “Content-Encoding” headers, you can use the following syntax to filter the output.

If your server is configured for gzipped content, but if it’s not working as expected, check for the presence of the “Via” request header. This header is usually inserted by proxies. The “Via” header can disable gzip compression unless the web server is configured to compress proxied requests. On Nginx, this is controlled by the “gzip_proxied” parameter.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }