Quick revision
The short answer
We treat the sale as a planned event: freeze content shortly before 10:00 and make any urgent change by pre-rendering and switching to a new version instead of invalidating. The event page is served from the CDN with stale-while-revalidate, request collapsing and an origin shield, so an expiry or purge costs one origin request per object; the shared page is separated from a small, separately protected availability API; every layer is warmed and load tested with a purge at the worst moment; and a virtual waiting room limits how many users reach the purchase flow.
What to remember
In this answer, we saw that a known sale should be planned so that no change can empty the cache at the worst moment. We freeze content and switch to pre-rendered versions instead of invalidating, configure the CDN with stale-while-revalidate, request collapsing and an origin shield, split the shared event page from a small availability API cached for seconds, warm every layer and load test a purge at peak, and put a virtual waiting room in front of the purchase flow with clear rules about who may slow or pause the sale.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We treat the sale as a planned event: freeze content shortly before 10:00 and make any urgent change by pre-rendering and switching to a new version instead of invalidating. The event page is served from the CDN with stale-while-revalidate, request collapsing and an origin shield, so an expiry or purge costs one origin request per object; the shared page is separated from a small, separately protected availability API; every layer is warmed and load tested with a purge at the worst moment; and a virtual waiting room limits how many users reach the purchase flow.
Why this question is asked
Known traffic peaks are the one kind of overload we can prepare for completely, which is why failing at one hurts. Last time, a single edit at 09:59 emptied the cache in front of the busiest minute of the year. Interviewers ask this to see whether we design for the change at the worst moment, not just for the steady state. In this answer, we will size the peak, decide how changes are made near the sale, configure the CDN, split the page into shared and dynamic parts, warm and test everything, and put admission control in front of the purchase flow.
1Sizing the Peak
Two million users in the first minute is about 33,000 page loads per second on average, and the first ten seconds after 10:00 will be several times that, because many users refresh at exactly 10:00:00. Each page load also fetches assets and calls APIs. Suppose the origin, our application servers and database, can serve 2,000 page renders per second. Then the CDN must answer well over 99 percent of requests by itself, and any event that sends even a few percent of traffic to the origin overloads it.
That is what happened last time. Invalidating the event page at 09:59 did not cause one rebuild; it caused every edge location, and every user hitting those locations, to ask the origin at the same moment.
2Freeze Content, Switch Instead of Invalidate
The first rule is organisational: content for the event is frozen from, say, 09:30, and the event's editors know it. But urgent changes happen, such as a corrected venue time. So the second rule is a procedure for them that never empties the cache. The new version of the page is rendered at a new versioned URL, the CDN is warmed with it, and then the small entry point that references it is switched. The old version stays cached and valid until the switch, and the new one is already cached when traffic reaches it.
In other words, a change at 09:59 becomes a pointer move, not a cache miss for two million people.
3Configuring the CDN to Absorb Expiries
Three CDN features turn one miss from millions of origin requests into one. Request collapsing makes an edge location send a single request to the origin for an object, however many users ask for it while the request is in flight. An origin shield, a designated mid-tier cache location, does the same across edge locations, so hundreds of locations make one request between them. And stale-while-revalidate lets the CDN keep serving the old copy while it fetches the new one in the background, so users never wait for the origin at all.
- UsersAbout 2 million in the first minute
- CDN edge locationsServe the shared page; collapse concurrent misses
- Origin shieldOne request per object from all edges
- Waiting roomAdmits users to purchase at a safe rate
- Origin servicesAvailability API cached for seconds in Redis
- DatabaseSees only admitted purchases and rare refreshes
6 layers, from the top down. Step through them one at a time.
With these headers, expiry is invisible to users and costs the origin one request per object per minute. Support for these directives and the names of collapsing and shield features differ between CDN providers, so we check ours and test them rather than assume.
4Separating the Shared Page From Live Data
The event page is the same for every visitor: artist, venue, date, seating map. That part can be cached aggressively, as long as nothing user-specific leaks into it, so the cache key must not include cookies, and login state is rendered in the browser. What changes during the sale is availability and price per section. Those come from a small API, for example /events/123/availability, cached for 2 to 5 seconds at the CDN and in Redis, with its own rate limits and collapsing. It is tiny and cheap to refresh, so a few seconds of staleness is fine; the purchase step checks real availability anyway.
This split means the heavy, shared content never needs to change during the sale, and the data that does change is small enough to refresh often without risk.
5Warming and Testing Every Layer
By 09:45, every layer should already hold what it needs: the page at the CDN, by requesting it through the edge locations that matter or with the provider's prefetch feature, the event and availability data in Redis, and the hot objects in each service's local cache. New pods started for the event should warm before they report ready.
Then test the failure that hurt us. In a load test at production scale, purge the event page at the moment of peak traffic and confirm that the origin sees one request per object, not a flood. A test that only checks the steady state would have passed last time too.
6Admission Control for the Purchase Flow
Caching can protect the page, but buying a ticket must reach the origin, and two million buyers cannot all be served at once. A virtual waiting room in front of the purchase flow gives each user a place in a queue and admits them at the rate the booking system can handle, for example 3,000 per minute, so excess traffic waits in a cheap, cached page instead of overloading the database. It is also fairer than letting whoever retries fastest win.
Finally, decide in advance who may pause the sale or slow admission, and on which signals. During an incident at 10:01 there is no time to find out who is allowed to make that call.
7Follow-up questions
Which metric would make you open the waiting room earlier?
The origin's own health, not the CDN's. If origin requests per second, the purchase API's concurrency or its p99 latency approach the capacity we measured in load tests, for example 70 percent of it, the waiting room should start admitting at a fixed rate before the origin degrades. A leading signal also helps: if the number of users on the event page at 09:55 is well above the forecast, we turn the waiting room on before 10:00 rather than react after.
What if the CDN itself has problems during the sale?
For an event of this size we would have a fallback: a static version of the event page in object storage behind a second CDN or a separate distribution, and DNS or traffic steering ready to switch. The waiting room should also be able to run from the edge, so it keeps the origin safe even if parts of the CDN fail.
Why not render the page dynamically with Redis behind it?
Because Redis and the application servers would still need to answer tens of thousands of requests per second for identical content. The CDN does that at the edge for almost nothing, and Redis is better spent on the small availability API.
8Conclusion
In this answer, we saw that a known sale should be planned so that no change can empty the cache at the worst moment. We freeze content and switch to pre-rendered versions instead of invalidating, configure the CDN with stale-while-revalidate, request collapsing and an origin shield, split the shared event page from a small availability API cached for seconds, warm every layer and load test a purge at peak, and put a virtual waiting room in front of the purchase flow with clear rules about who may slow or pause the sale.
Open with
Two million users in a minute means the CDN has to answer more than 99 percent of requests, so the plan is about making sure nothing can empty that cache at 10:00.
Then, if they want more
First, a content freeze from about 09:30, and an urgent-change procedure that pre-renders the new page under a new version, warms it and switches to it, instead of invalidating and letting the traffic rebuild it.
Second, the CDN: s-maxage with stale-while-revalidate and stale-if-error, request collapsing and an origin shield, so an expiry or purge means one origin request per object and users keep getting the old copy. Third, separate the parts.
The event page is the same for everyone, so it is cached hard with no cookies in the key, while availability and price come from a small API cached for a few seconds with its own limits.
Fourth, warm every layer, CDN, Redis and local caches, before 09:45, and load test with a purge at the peak, because that is what broke last time.
Fifth, a virtual waiting room in front of the purchase flow that admits users at the rate booking can handle, and an agreed person and set of signals for slowing or pausing the sale.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "How do you plan caching and load protection for this known event so the page stays up...": https://scrivio-interview-library.netlify.app/architecture/caching-strategies/7d3c0fec6e/