How to perform HTTP compression test

To quickly perform HTTP compression test on https://example.org execute command:

$ curl -s -I --compressed  https://example.org | grep Content-Encoding
Content-Encoding: gzip

Empty result means that it doesn't support compression.

Alternatively, you can be more precise and define custom header.

$ curl -s -I -H 'Accept-Encoding: gzip,deflate' https://example.org | grep Content-Encoding >/dev/null && echo "It supports compression" || echo "It does not support compression"
It supports compression
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu