How Cloudflare Squeezed Petabytes More Cache From the Same Hardware

Cloudflare tested adding Zstandard compression inside its caching layer and found it could dramatically cut storage use without buying new hardware. Here's what that experiment reveals for anyone running their own caching setup.

The problem: cache storage fills up fast

Anyone who runs a busy website knows the drill. You add a cache — a layer that stores copies of files so your server doesn’t have to rebuild them for every visitor — and it works brilliantly until it fills up. At that point you either buy more storage or start evicting useful data early. Both options cost you.

Cloudflare, which handles a significant chunk of the world’s web traffic, faces this problem at a scale most of us will never reach. But the engineering answer they came up with is directly relevant to anyone managing their own server or VPS.

The experiment: compress the cache itself

Their idea was straightforward: what if the files sitting in the cache were themselves compressed? Not compressed for the browser — that already happens — but compressed internally, so each item takes up less physical disk space.

To do this, they built the feature into Pingora, Cloudflare’s own open-source proxy framework (the software that sits between the internet and their servers and decides what to store or forward). They used Zstandard, a modern compression algorithm developed by Meta, which is known for being fast enough not to slow things down noticeably while still shrinking data significantly.

The results were striking. In their prototype, cache storage requirements dropped dramatically — meaning the same physical hardware could hold far more cached content. For Cloudflare, operating at petabyte scale, that translates into enormous cost savings without a single new drive being installed.

What this means if you run your own server

You probably aren’t running petabytes of cache, but the principle scales down perfectly. Whether you use Nginx, Varnish, or another caching tool on your VPS, the same trade-off applies: disk space costs money, and anything that lets you cache more content on the hardware you already have is worth considering.

Zstandard is widely available and already supported by many Linux distributions. If your caching layer doesn’t compress stored objects by default, it’s worth checking whether a configuration option or a small plugin can enable it. The CPU overhead is low enough that on most modern servers you won’t notice a performance difference.

Pingora itself is open source, so technically adventurous self-hosters can already experiment with it directly.

The bigger picture

This experiment is a reminder that hardware efficiency is becoming as important a concern as raw performance. As storage and bandwidth costs remain a real line item for small operators, techniques like in-cache compression — once only worth the engineering effort at massive scale — are now practical for anyone willing to spend an afternoon on configuration. Expect more caching tools to adopt this approach by default over the next couple of years.