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.

TrackBuilding a Website
Lessons14
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: Web Hosting

Lessons

  1. How a CDN serves your contentEdge locations, cache hits and misses, origin shielding, and how to tell which layer answered a request.
  2. Cache headers and cache keysThe headers that decide how long the edge holds a copy, and what makes two requests share one entry.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.