CDN Basics
Content Delivery Network setup and configuration.
What is CDN?
CDN Benefits
• Faster content delivery (edge servers)
• Reduced bandwidth costs
• Better availability & redundancy
• DDoS protection
• SSL/TLS termination
Popular CDN Providers
Cloudflare
Free tier, DDoS protection, DNS
AWS CloudFront
Integrated with AWS services
Fastly
Real-time purging, edge computing
Akamai
Enterprise-grade, largest network
BunnyCDN
Affordable, fast, simple setup
CDN URL Patterns
Subdomain
https://cdn.example.com/assets/logo.png
CDN domain
https://d1a2b3c4d5.cloudfront.net/logo.png
With versioning
https://cdn.example.com/v2/assets/logo.png
Cache Control for CDN
Long cache for static assets
Cache-Control: public, max-age=31536000
CDN-specific headers
CDN-Cache-Control: max-age=86400
Surrogate-Control: max-age=86400
Bypass CDN for dynamic content
Cache-Control: no-cache, no-store