Cloudflare Implements Cache Transcoding to Optimize Cache Storage with Zstandard

Arpit Bhayani

Arpit Bhayani

Sep 03, 2026 • 1 min read


Cloudflare found a neat way to squeeze more out of their cache and save a ton of money and storage. Here’s what they did …

“compress what is already sitting there”, and it is called Cache Transcoding. The idea is simple…

When a response enters the cache, their proxy encodes the body with Zstandard before writing it to disk. It stays compressed the whole time it is cached and moving between data centers, and only gets decoded right before it hits the client.

Not everything gets this treatment.

Given that the images and video are compressed already, so recompressing them is wasted CPU. Hence, they focus on compressing texts - html, css, json, js, etc.

This compression resultes in a 2.8x reduction with zstd level 3.

This tradeoff makes sense because assets get read far more often than they get written and hence they prefer to pay a small decode cost repeatedly.

Compress once, decode cheap that is the whole idea.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses