Skip to content

Instantly share code, notes, and snippets.

@tomkul
Forked from timendum/check-gzip.sh
Created August 7, 2019 10:24
Show Gist options
  • Save tomkul/a232a18d1f6ddb0f9bac3cf569d5cfe8 to your computer and use it in GitHub Desktop.
Save tomkul/a232a18d1f6ddb0f9bac3cf569d5cfe8 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