To measure gzip sizing for a request, you don’t need to actually gzip it, just use pipe
| to pipe the stream from
# before gzip
As you can see, before gzip it’s 57847 bytes, after gzip it’s 10443 bytes.
You could do same things to measure a file gzip sizing by gzip with
-c option, so it won’t actually gzip it.
$ gzip -c foo.jpg | wc -c