Content compression is crucial as it enhances download speed and reduces traffic costs. To verify if content is compressed, examine the content encoding of the response and compare the content length between compressed and uncompressed content.
For instance, the following is a compressed object, as indicated by the Content-Encoding header and the object size:
>curl -I http://edition.cnn.com/ --compressed
HTTP/1.1 200 OK
access-control-allow-origin: *
cache-control: max-age=60
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
....
Content-Length: 30340
....
Contrastingly, this is the same object, but uncompressed:
>curl -I http://edition.cnn.com/
HTTP/1.1 200 OK
access-control-allow-origin: *
cache-control: max-age=60
Content-Type: text/html; charset=utf-8
....
Content-Length: 137752
....
Comments
1 comment
I’m motivated to implement these checks in my own projects to ensure I’m maximizing efficiency!
Please sign in to leave a comment.