Interview Prep/Networking/Load Balancing, Proxies & CDN

How do you invalidate a CDN cache after a deployment?

IntermediateScenarioLoad Balancing, Proxies & CDN
Answer

Situation read → You must clear stale objects or avoid needing to.

What I'd do →

  1. Prefer versioned file names (app.4f3a9c.js) with long TTLs and a short TTL on index.html
  2. For emergencies invalidate paths: aws cloudfront create-invalidation --distribution-id E123 --paths '/index.html' '/api/config*'
  3. Watch cost: first 1,000 paths a month are free, then billed
  4. Verify with curl -sI and check X-Cache: Hit from cloudfront or Miss

Why → Immutable asset names turn invalidation from a process into a non-event.

Interview tip → Say you design cache keys so deploys never need a global purge.

All Networking questions Roadmap: Networking for DevOps

More on Load Balancing, Proxies & CDN