We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
This idea carries a full system design question on its own. Each walks through the full answer.
System Design Masterclass · Caching Strategies
Free preview: the first 2 parts of this 11-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Caching Strategies
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
The previous lesson took warming apart. A warming job predicts what a whole population will want, hours before they want it, from data that is already going stale. Prefetching is the same idea with the reach cut down to almost nothing, and that changes everything about it.

The accuracy of a prediction is mostly a function of how far ahead it reaches. Prefetching makes a much smaller claim about a much shorter interval, from evidence that is right in front of you.
That accuracy is real and it is measured below. What follows is the part that is usually left out, which is what the prefetches cost while they are being right.

A prefetch is an ordinary request. It takes a worker, a connection and a place in the queue, and the only thing that makes it special is that nobody is waiting for it.
To find out what that exchange rate actually is, the whole thing has to be simulated as a queue and not as a cache, because the cost lands on other people's requests and not on the one being prefetched.

Each reader continues to the next page with probability 0.55 after about three seconds of thinking, so a session runs a little over two pages on average.

The only quantity that decides whether prefetching was worth doing is what the readers who did not get a hit had to wait. The hit rate cannot answer that, because the requests that got slower are exactly the ones it does not count.