DevOps
CDN
A network of edge servers that cache and serve static assets (and increasingly compute) from a location physically near each user, cutting latency and offloading your origin. It also absorbs traffic spikes and helps blunt DDoS. The main discipline is cache-control headers and invalidation, so users do not get stale files after a deploy.
Purpose
A CDN is a network of edge servers around the world that cache your content close to users, cutting the physical latency of every request and absorbing traffic that would otherwise hit your origin. Increasingly the edge also runs logic — redirects, auth checks, even full functions.
When to Use It
Static assets (JS, CSS, images, fonts) and entire static sites; video delivery; API response caching where headers allow. It doubles as a shield: edge capacity soaks up spikes and blunts DDoS attacks before they reach you. This portfolio itself is served from Cloudflare's edge.
Trade-offs
The eternal cache problem in distributed form: a stale file cached at 300 edges after a deploy. The cure is content-hashed filenames (each build produces new URLs cached forever) rather than manual purges. Dynamic, personalised responses also gain little from edge caching without careful key design.
Implementation
Set explicit Cache-Control headers: immutable, hashed assets get max-age=31536000, immutable; HTML gets short or no caching so deploys appear promptly. Let the build pipeline hash filenames, use purge APIs for emergencies, and serve everything through the CDN so TLS and HTTP/2/3 terminate at the edge.