What Is a CDN and How Does It Work?
A Content Delivery Network stores copies of your site at hundreds of global locations (edge nodes) and serves each visitor from the closest one. The result: lower latency, absorbed traffic spikes, and an attack surface that is the CDN's problem instead of yours.
CDN responsibilities
| Layer | CDN handles | Origin keeps |
|---|---|---|
| Static | Edge cache | Truth |
| Dynamic | Routing | Compute |
| Protection | Absorption | Rules |
The mechanics
- You point your DNS at the CDN: either an A record to their anycast IPs or a CNAME to their hostname (flattened at the apex).
- A visitor resolves your domain; DNS answers with the nearest edge node’s address.
- The edge serves cached content instantly; misses fetch from your origin and cache per your rules.
- Dynamic requests pass through the edge to your origin over optimized routes.
What it changes for you
- Your origin IP hides behind the CDN: an uptime and security win, and the reason A records point at edge IPs.
- Cache rules become configuration: what to cache, for how long, and what always passes through (APIs, logged-in pages).
- TLS is terminated at the edge: certificates are managed by the CDN or uploaded by you.
- Purge control matters: deploys need cache invalidation or versioned asset names.
CDN vs no CDN
A personal blog on a single-region server gains global speed and DDoS absorption. An already-fast site gains resilience more than speed. What no site gains: freedom from correct DNS, because the CDN is only reachable if your records point at it reliably. Verify changes with the propagation checker; CDN cutovers live and die on DNS. To trace multi-hop CDN alias chains and confirm whether a proxied subdomain flattens to edge IPs, run the CNAME record lookup.
Frequently asked questions
Does a CDN host my website?+
No: it caches and serves copies. Your origin server or hosting remains the source of truth.
Why is my origin IP still visible?+
Direct connections to historical IPs, subdomains not proxied, or mail records revealing infrastructure. Full origin hiding requires deliberate configuration.
Do CDNs work with dynamic content?+
Yes: dynamic requests are not cached but still benefit from optimized routes between edge and origin.
What is cache poisoning then?+
An attack on the cache itself: tricking the edge into storing attacker-controlled responses. Reputable CDNs defend against it; keep cache keys conservative.
Do I need a CDN with static hosting?+
Static hosts on global platforms already behave like CDNs; a second layer is usually redundant.
How do I purge the cache after deploying?+
Every CDN has a purge API/dashboard action; versioned asset filenames make most purges unnecessary.
Related
Last verified: 2026-12-02