I think the only reliable way to get the size, is to actually download the file. However, curl offers a very convenient option for only outputting data of interest
-w/--write-out <format>
Defines what to display on stdout after a completed and successful operation.
[...]
size_download The total amount of bytes that were downloaded.
which means you can do something like this:
curl -so /dev/null http://www.whatsmyip.org/http-compression-test/ -w '%{size_download}'
Output:
8437
And to get the compressed size:
curl --compressed -so /dev/null http://www.whatsmyip.org/http-compression-test/ -w '%{size_download}'
Output:
3225
After that your comparison should be trivial.