The technical definition
A CDN is a globally distributed network of servers ("edge nodes") that cache static and semi-static content — images, CSS, JavaScript, videos, and increasingly whole HTML pages — close to end users. When someone in Tokyo visits a website whose origin lives in Frankfurt, the CDN serves the assets from an edge node inside Japan instead of round-tripping across two continents.
Result: page load times drop 30-70%, origin server bandwidth drops 60-90%, and the origin can handle more concurrent visitors because most requests never reach it.
How a CDN works
- You point your DNS at the CDN (or the CDN sits in front of your origin as a reverse proxy)
- A user requests a page
- DNS routes them to the nearest CDN edge node (via anycast IP)
- If the edge has a cached copy, it serves immediately (a "cache hit")
- If not, the edge pulls from your origin, caches, and serves ("cache miss")
- Subsequent requests from that region are served from the edge cache
What a CDN caches
- Static assets — images, CSS, JS, fonts, videos (always cacheable, TTL usually 1 hour to 1 year)
- HTML pages — increasingly common for cacheable content like landing pages, blog posts (TTL from a few minutes to hours)
- API responses — read-only, cacheable API endpoints (with careful cache-key design)
- Video streaming — HLS/DASH chunks cached at edge for low-latency delivery
What a CDN does not cache
- Logged-in user dashboards (unique per session)
- POST requests (mutations)
- Real-time data (stock prices, live scores) — unless the TTL is measured in seconds
Popular CDN providers
| Provider | Best for | Free tier |
|---|---|---|
| Cloudflare | General web hosting + DDoS + WAF + workers | Yes (generous) |
| Fastly | Complex edge logic (VCL config), news sites | $50 free credit for new accounts |
| AWS CloudFront | AWS-integrated stacks, S3 origin | 1 TB / 10M requests/mo |
| Bunny.net | Cheap egress, video streaming | No, but very cheap: $0.005/GB |
| KeyCDN | Predictable pay-as-you-go | $25 free trial credit |
When you need a CDN
- Your users are geographically distributed (multiple countries or continents)
- You serve any meaningful volume of images, video, or downloads
- You want DDoS protection (most CDNs include basic mitigation)
- Your origin server is regularly hit by traffic spikes
- You want HTTPS/SSL managed automatically (most CDNs issue free certs)
When you don't need a CDN
- Your entire audience is in one country/city and your server is already there
- All content is dynamic and personalized (nothing cacheable)
- You're pre-launch with under 100 daily visitors — origin can handle it
Common pitfalls
- Cache invalidation — when you update content, purging the CDN cache is easy to forget. Solutions: cache-busting file names (e.g.,
styles-v42.css) or short TTLs on HTML with long TTLs on static assets. - Origin still receives all writes — a CDN doesn't offload database writes or logged-in traffic. Your origin still needs to handle those.
- Cost surprises on video — CDNs charge for egress; a viral video can bill thousands of dollars in bandwidth.
CDN on Hostiger
Every Hostiger VPS works cleanly behind Cloudflare (recommended for its free tier + DDoS protection). LiteSpeed-based Hostiger Web Hosting plans include built-in QUIC.cloud CDN integration for WordPress sites — no configuration required.