# CDN usage and optimization — Web Performance Optimization

Source: https://www.skillbyai.com/en/web-performance/web-perf-08

> Leverage Content Delivery Networks to reduce latency and improve global performance.

## CDN principles and selection

CDN caches content at edge locations closest to users, reducing round-trip time. Popular options: Cloudflare, AWS CloudFront, Akamai. Choose based on coverage, performance in your target regions, and pricing.

## CDN configuration best practices

Configure cache TTL, compression and geographic routing. Monitor cache hit rate (target >90%). Use origin shielding to reduce load on primary servers. Purge cache after deployments.

## CDN performance measurement

Monitor TTFB from different geographic regions. Use tools like Speedtest.net, WebPageTest with various locations. A/B test with/without CDN to quantify improvement (typically 30-50%).

Quick check

**Quiz:** What is a typical cache hit rate target for CDN?

- [x] >90%
- [ ] >50%
- [ ] >70%
- [ ] <10%

*Answer:* >90%. A high hit rate means most requests are served from the edge instead of your origin.
