CDNs & Caching
Serving fast from an edge near the visitor.
CDNs & Caching is taught here in 14 lessons, running from How a CDN serves your content through to Edge architecture: personalisation and A/B testing at the edge. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.
| Track | Building a Website |
| Lessons | 14 |
| Level | Beginner to intermediate |
| Reading time | about 3 hours |
| Prerequisites | Helpful, but not required: Web Hosting |
Lessons
- How a CDN serves your contentEdge locations, cache hits and misses, origin shielding, and how to tell which layer answered a request.
- Cache headers and cache keysThe headers that decide how long the edge holds a copy, and what makes two requests share one entry.
- Invalidation, purging and what not to cacheHow to retire a cached copy quickly, why fingerprinted URLs beat purging, and the responses that must never be stored.
- Choosing a CDN and connecting an originComparing providers on the things that matter, DNS integration, origin configuration and host headers, TLS at the edge, staging domains, and validating the first deployment.
- Cache hierarchy: browser, edge and origin cachesHow the three cache layers interact, why a browser hit still helps, the revalidation flow, proxy caches, and designing so the edge absorbs the traffic.
- Static asset optimisation: compression and modern imagesBrotli and gzip negotiation, minification and bundling decisions, WebP and AVIF with fallbacks, responsive image markup, and content hashing for long-lived caches.
- Edge functions, redirects and rewritesRedirects and rewrites at the edge, the difference between rewriting and proxying, edge runtime limits, geo and header-based routing, and simple A/B routing.
- Image CDNs and on-the-fly transformationOrigin-based versus URL-based transformation, resize and quality parameters, format negotiation, caching generated variants, and the pricing shapes that catch people out.
- Signed URLs, token authentication and hotlink protectionSigned URL and cookie schemes, expiry and IP restrictions, protecting private content without breaking the cache, hotlink blocking, and the limits of each control.
- Security at the edge: WAF, DDoS and bot managementManaged and custom WAF rules, rate limiting at the edge, how DDoS absorption works, bot scoring and challenges, and avoiding rules that block real customers.
- Video and large file deliveryRange requests and seeking, segment-based streaming, adaptive bitrate basics, how large files are cached and evicted, and controlling bandwidth cost.
- Measuring CDN performance and debugging cache issuesReading cache status headers, hit ratio and origin offload, TTFB and real user monitoring, and a step-by-step workflow for a suspected cache miss.
- Multi-CDN, failover and cost optimisationWhen a second CDN is worth it, DNS-based and client-based steering, health-checked failover, log unification, and controlling egress and request costs.
- Edge architecture: personalisation and A/B testing at the edgeSplitting a cached shell from personalised fragments, edge key-value stores, experiment assignment at the edge, and keeping cache keys consistent for personalised responses.
More in Building a Website
SEO Basics Domains & DNS Web Hosting Accessibility
FAQ
How long does the CDNs & Caching course take?
It has 14 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for CDNs & Caching?
Not strictly. It helps to have read Web Hosting first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after CDNs & Caching?
Continue with Accessibility (14 lessons), the next course in Building a Website.