Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -euo pipefail
- if [ $# -ne 1 ]; then
- echo 1>&2 "Usage: $0 URL"
- exit 3
- fi
- echo "Checking $1"
- curl -L -I -H "Accept-Encoding: gzip,deflate,br" "$1" --silent | grep -i "Content-Encoding:" || echo "Content-Encoding not found in response"
- echo -ne "compressed:\t"
- curl -L -H "Accept-Encoding: gzip,deflate,br" "$1" --silent --write-out "%{size_download}" --output /dev/null
- echo -ne "\nuncompressed:\t"
- curl -L "$1" --silent --write-out "%{size_download}" --output /dev/null
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement