AlgoViz

CDN cache invalidation

medium 30 min

How to make a CDN stop serving an outdated copy: let it expire, purge it, mark it stale, give the new version a new name, or purge a whole group by tag.

Where it shows up

The same pattern appears across everyday software.

  • Front-end builds

    Bundlers write a hash into file names and a manifest that maps names, so scripts can be cached for a year.

  • Fastly

    Surrogate keys allow one call to purge all responses with a key, and soft purge marks them stale.

  • Cloudflare

    Offers purge by address, host, tag, prefix and everything, and an invalidate option that revalidates instead of removing.

  • Amazon CloudFront

    Invalidates paths and, when configured, tags. It recommends versioned file names for files that change often.

  • News correction

    A corrected article is purged by tag, so the page, the front page and the topic list change together.

  • Wrongly published file

    Remove it at the origin, hard purge the exact address at every provider, and replace any secret it contained.