Common misconception - CDNs can *only* cache images and videos

Arpit Bhayani

Arpit Bhayani

Apr 11, 2025 • 1 min read


Common misconception - CDNs can only cache images and videos.

To be honest, CDNs do not care what they get from the origin servers. For them, it is just a stream of bytes they can cache on edge servers for some time.

Because it is a transparent cache that sits between the user and the origin, you can use it to cache images, videos, JS bundles, and even API responses where the response is not supposed to change often, for example

  • Popular searches (semi-personalized)
  • Trending topics (semi-personalized)
  • Feed for specific cohorts of users (Hotstar, Prime, Netflix, etc.)

Like always, whenever we cache things, we always work with this assumption that you are okay serving stale data to users; this holds if you choose to cache API responses as well.

Strong opinions usually have exceptions; dig deeper.

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