Member-only story
Compression Techniques: Gzip vs Brotli vs Zstandard
I’ll be honest with you: for the longest time, I just used Gzip for everything because that’s what everyone else was doing. Enable Gzip, boom, done. Files got smaller, websites loaded faster, everyone was happy.
Then one day I was looking at our bandwidth bills and thinking “there’s gotta be a better way.” That’s when I discovered Brotli. And then Zstandard. And then I went down this whole rabbit hole of compression algorithms.
Turns out, the compression world has moved on since Gzip became the standard. There are better options now, but nobody talks about them. So let’s talk about them.
Why Compression Even Matters
Before we dive into the algorithms, let’s talk about why this matters. When you compress your website’s assets, you’re reducing the amount of data sent over the network. Less data means faster load times and lower bandwidth costs.
A typical uncompressed JavaScript bundle might be 500KB. With Gzip, it drops to about 150KB. With Brotli, maybe 130KB. That 20KB difference might not sound like much, but across millions of requests, it adds up.
Plus, for users on slow connections or mobile data, every kilobyte counts.