Compression on the web is surprisingly underused

Eric Lawrence posted an article the other day on web compression, focusing a bunch of different algorithms, what should get compressed and how to get the best performance on your site based on mixing minification and compression. It’s a great read with lots of good, useful information.

Isn’t compression used on most sites already?

This got me curious of the state of compression on the web. How many sites use some form of compression? My initial assumption was > 90%, but even that sounded low. I looked up some stats on W3Techs, which provides “information about the usage of various types of technologies on the web.” Based on their studies, they found that:

Compression is used by 58.1% of all the websites.

Fifty-eight point one percent.

That’s it? I was astounded when I first read that number and I’m still pretty surprised now. There are estimated to be over 1 billion websites in existence right now, which means 500 million of them are sending uncompressed data. That’s a lot of useless bytes being sent through the wire.

It makes no sense to not enable compression. It’s incredibly easy to set up in both Apache and IIS (on IIS you seriously just have to click a few buttons). Enabling it will only affect users for the good, because not only have all major browsers supported it for the past ~10 years, they all send the Accept-Encoding: gzip header if they support compression. If they don’t send the header, the server won’t compress the response. Everyone gets their content either way, some will just get it faster than others.

The only downside is a slight increase in CPU usage, but that is a minimal increase for a massive decrease in response size. To show how much the response size is decreased, we can use the Composer in Fiddler to run two requests to, one with the Accept-Encoding: gzip header and one without:

Without CompressionWith Compression (gzip)Savings
79,203 bytes21,499 bytes72.8%
Multiply that over thousands of users a month and that’s a significant bandwidth savings.

Compress yourself before your wreck yourself

Check yourself before you wreck yourself
Do yourself a favor and make sure that compression is enabled on your website. It’s the ultimate low-cost, high reward feature.

Your server’s internet pipes will thank you.