Skip to content

Instantly share code, notes, and snippets.

@seralexeev
Forked from timendum/check-gzip.sh
Created December 28, 2016 13:12
Show Gist options
  • Save seralexeev/84193de17d24607497a55f69520b964d to your computer and use it in GitHub Desktop.
Save seralexeev/84193de17d24607497a55f69520b964d to your computer and use it in GitHub Desktop.
Check if gzip is enabled [ http bash curl ]
curl -I -H "Accept-Encoding: gzip,deflate" "$URL" --silent | grep -i "Content-Encoding:"
# OR
curl -H "Accept-Encoding: gzip,deflate" "$URL" --silent --write-out "%{size_download}" --output /dev/null
curl "$URL" --silent --write-out "%{size_download}" --output /dev/null
# 2nd must be greater the 1st
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment