Skip to content

FlashcardNot attempted

CDN edge caching

Recall it before you reveal

What are origin and edge in a CDN, what is a cache miss vs a hit, and what happens to edge copies on a deploy?

Space to reveal
Show answer & explanation
  • Origin: where your files really live (the build output in storage, or your server).
  • Edge: CDN servers in many locations, close to users.

An edge only holds a file after someone near it requested it. The first request is a miss: the edge fetches from the origin, keeps a copy (if the headers allow it) and responds. Later requests nearby are hits, served from the edge.

On a deploy, stale edge copies of unhashed URLs (like the HTML) must be dropped: some platforms do this automatically per deployment (e.g. Vercel, Netlify); on others you create an invalidation/purge yourself (e.g. CloudFront). Hashed assets don't need purging: new code has new URLs.