System design

Stage 1 · Lesson 7 of 10

CDNs and edge caching

Core concepts and building blocks

A (CDN) keeps copies of your content in data centres close to users. A visitor in Sydney gets an image from Sydney instead of Virginia. That cuts a 200 ms to 20 ms and takes load off your origin, the servers that hold the real copy.

CDNs are ideal for static files, images and video. They can cache API responses too when the headers allow it. You control them with Cache-Control headers and a (time to live), which says how long a copy counts as fresh.

Use such as app.3f9a.js, so each deploy creates a new name and never needs a purge. A fetches a file from your origin the first time someone asks for it. A push setup uploads content ahead of time.

Common trapcaching personalised responses, which can show one user another user's data.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking System Design Fundamentals

    Design Gurus · Beginner · Subscription

    Load balancing, API gateway, proxies, caching, CAP and Bloom filters: week 1 of the plan in order

  • GitHub repoFree
    The System Design Primer

    Donne Martin · Intermediate

    Free: its scalability, latency, availability, CDN, load balancer and cache sections

Keep handy

  • Free Design Gurus concept index for looking up a term in the middle of a lesson

Also worth your time

Mark this stage as not done?