Varnish 00:00:01 One expensive page, two visitors A news site needs four hundred milliseconds to assemble its front page. Varnish sits in front of the origin. Its first decision is whether two visitors can safely share the same representation. A GET without cookie or Authorization. The rules say: look it up. The key is the URL and the host. Nothing is there. The app server builds the page in 400 ms. The object is fresh. The app server does nothing. A cache key defines who can reuse the answer. It must include the inputs that change the public representation, and the response must be eligible for shared caching. 00:00:44 A thousand people arrive together The front page is absent when a breaking story brings a crowd. With request coalescing, the first miss starts an origin fetch while compatible requests wait for its result. Client 1 misses and starts the fetch. They miss too, find a running fetch, and wait. The page arrives once and is stored. All thousand get the same copy. Coalescing protects one cache key. A thousand different keys, a non-cacheable response, or different behavior in the configuration changes how much work reaches the newsroom. 00:01:21 Decide how old a headline may be Give this page a two-minute fresh lifetime and a short grace interval. Grace is an editorial and engineering decision about whether yesterday's copy is better than a wait or an error. Fresh. Served from memory. The page is beyond its fresh lifetime but inside the example grace period. A reader can receive the older copy while a refresh begins. They get the old copy too. No second fetch. When the retained object is no longer eligible for grace, this reader waits for the origin in our example. Configure both a freshness budget and an outer stale limit. A public headline and an account balance deserve different answers to the same failure. 00:02:06 Keep an account page personal The next request is for a subscriber's account. This page can contain personal data. Treat it as a separate caching decision, even though the hostname is the same as the newspaper's front page. A miss for /account. The fetch starts. In this configuration the response is uncacheable. Varnish can retain a marker for its special miss behavior, without retaining the personal response as reusable content. The next two users get their own origin fetches rather than a shared account response. A rule that passes /account in vcl_recv says the same before any lookup. An explicit pass rule communicates why the request should reach the origin. Confirm that two signed-in users never receive one another's representation. 00:02:56 An origin outage changes what can be served The origin's health probes begin failing. The edge can still have useful public objects, but cannot invent an account page or a brand-new article it has never seen. Old copies are served for at most 10 seconds. Three of five probes fail. The cap is no longer set. Requests for eligible retained pages can receive stale content within the configured grace policy. Uncached pages or logins still need a working origin. The probe is happy again. Old pages are refreshed as people ask for them. Separate the fraction served from cache, the age of those responses, and the origin's recovery rate. A fast cached reply says little about the health of an uncached operation.