In this lesson · topic 1 of 7
Topic 1
One origin, every user
3 min read
Two costs of serving everything from one place
An origin is the server that holds the real content. If every user talks to it, two things go wrong.
First, distance. A user far from the origin waits for every round trip to cross the distance. The speed of light in fibre sets a floor that no code can lower.
Second, repetition. Most traffic asks for the same few things: the home page, a stylesheet, a popular image. The origin builds or reads the same bytes again for every request. Its load grows with traffic, not with how much distinct content you have.
Copies near the user
A content delivery network, or CDN, runs caches in many places. These are called edges. An edge keeps copies of responses it has seen. When the next user asks for the same thing, the edge answers on its own. The origin is not involved.
In the lab, 10 requests arrive each tick for 100 objects, and a few objects are far more popular than the rest. With four edges and a copy kept fresh for 60 ticks, the edges answered 65 percentmeasured of requests. The origin handled 1385measured of the 4,000.
That share is the cache hit ratio. It is the number to watch. The rest of this lesson is about what raises it, what it costs, and how copies stay correct.
Predict first