Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/bin/bash
  2. set -euo pipefail
  3.  
  4. if [ $# -ne 1 ]; then
  5. echo 1>&2 "Usage: $0 URL"
  6. exit 3
  7. fi
  8.  
  9. echo "Checking $1"
  10.  
  11. curl -L -I -H "Accept-Encoding: gzip,deflate,br" "$1" --silent | grep -i "Content-Encoding:" || echo "Content-Encoding not found in response"
  12.  
  13. echo -ne "compressed:\t"
  14. curl -L -H "Accept-Encoding: gzip,deflate,br" "$1" --silent --write-out "%{size_download}" --output /dev/null
  15. echo -ne "\nuncompressed:\t"
  16. curl -L "$1" --silent --write-out "%{size_download}" --output /dev/null
  17. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement