When a meta-framework refreshes a prerendered page out of band instead of rebuilding the site, what does a visitor receive while that render runs?
answer
- freshness traded for first byte
- the request is answered from storage
- the render happens off the request path
- the swap only helps later visitors
basics
~20 sThe stored prerendered copy, served immediately. The refreshed render runs outside that request and replaces the stored copy when it finishes, so only later visitors see the new HTML: nobody waits for the refresh, but whoever arrives during it gets the older page.
solid answer
~40 sThe visitor gets whatever is already stored for that path — the older HTML, returned at the speed of handing back a finished document. The refresh is deliberately decoupled from the response: the framework renders the path again outside the request/response cycle, reads current data, and swaps the stored copy when that render completes. Requests that land after the swap get the new page; requests that land before it get the old one. That is the trade the model makes: no visitor pays the render cost, and no full-site rebuild is needed to move one page forward, in exchange for a window in which the HTML being served is known to be behind the data. The window closes for later visitors, never for the ones inside it.
go deeper
Remember the order: the stored copy goes out first, and the fresh render happens afterwards and off to the side. Nobody waits for it, and the page a visitor sees can be older than the data behind it.
Explain the decoupling. The response is served from storage while a separate render reads current data and swaps its output in. The swap helps the next requests, not the request that was in flight when it started.
Show what it costs in production: a real window of out-of-date content, refresh scoped per path rather than per site, and a promise of eventual freshness that you have to measure rather than assume.
Frame it as a contract with the business. This surface may serve content that is minutes old, in exchange for stored-document latency and a render bill that scales with pages refreshed instead of with traffic.
## What "out of band" means here A **prerendered page** is HTML that was produced before the request arrived and kept as a finished document. Serving it is cheap — the server hands back bytes it already has, with no data access and no component tree to execute. The price of that cheapness is **age**: the HTML froze whatever the data said at the moment it was produced. **Background regeneration** is the model that refreshes such a page *without* producing it inside the request that found it old, and *without* reproducing every other page in the site. The refresh happens on its own track — out of band — and its result is published by replacing the stored copy. ## The order of events 1. A request arrives for a path that already has a stored copy. 2. That copy is returned immediately, exactly as it is, whether or not it is considered current. 3. Separately from that response, the framework renders the path again, reading data as it is now. 4. When the render completes, its output replaces the stored copy for that path. 5. Requests arriving after step 4 receive the new HTML. Requests that arrived between steps 1 and 4 received the old one. The response in step 2 does not depend on step 3 finishing. That decoupling is the whole mechanism, and it is also the whole cost. ## Who pays and who benefits - **No visitor pays the render.** First-byte time stays that of a stored document, even at the moment a refresh is running. - **Requests inside the window get the older copy.** Every request served while a render is in flight receives HTML that predates it. - **The refresh is scoped to a path.** One page can move forward while its siblings keep the copies they have; there is no all-or-nothing publish. - **The render bill tracks pages refreshed, not views.** A page viewed a million times between refreshes is rendered once, not a million times. - **New HTML reaches users without a deploy.** The stored copy changes while the deployed build stays the same. ## Where it sits among the render modes | Model | When the HTML is produced | Who waits for data | Age of what a visitor sees | |---|---|---|---| | Prerender ahead of time | before deploy, for every path | nobody, at request time | as old as the last full build | | Render inside the request | during the request | every visitor | current as of that request | | Refresh out of band | before deploy, then again after publication | nobody | current as of the last completed refresh | Read the third row as the compromise it is: it buys the first row's latency and the second row's ability to move without a rebuild, and pays for both with a period of knowingly out-of-date HTML. ## What the model does not promise - **It does not promise a current page to any particular visitor.** The guarantee is *eventually fresh*, not *fresh now*. - **It does not bound the age at the refresh interval alone.** The render itself takes time, and a path nobody asks for, or one whose renders keep failing, can hold an old copy for much longer. - **It does not partially update a served page.** The replacement is of a whole stored document; a visitor is not shown a page that fills in as the render proceeds. - **It does not make personalised content safe to store.** A stored copy is by construction the same for whoever asks for it next. ## Where frameworks differ Meta-frameworks converge on the shape above and diverge in the details around it: some perform the refresh in the same process that served the request, others hand it to a separate worker; some make the refreshed output visible to every server instance at once, others leave each instance with its own view until the next publication; some will serve a stale copy for a bounded period and then start holding requests instead, while others serve the stale copy however old it is. Treat the decoupled response as the invariant and the rest as a property of the framework and the hosting target you are on — including *what causes* a page to be considered due for refresh, which is a separate concern from what the request receives once it is. ## How to talk about it Say the sequence, not the label. "The stored page answers the request; a fresh render runs beside it and replaces the stored page when it is done; the next visitors get the new one." Then name the cost out loud — that at least one visitor was served content older than the data — because that sentence is what an interviewer is listening for, and it is the one most candidates leave out.
- Does the HTML produced by a refresh ever reach the visitor whose request was in flight when it ran?Not in that response — it was already sent from the stored copy before the render finished. The same person sees the new page on a later request for that path, once the replacement has happened. That is the practical meaning of eventual freshness: the improvement lands on subsequent requests, not retroactively on the one that triggered nothing.
- When one path is refreshed, what happens to the other prerendered pages?Nothing. Refresh granularity is the path: the other stored copies keep answering requests exactly as before until they are refreshed in their own turn. A site can therefore sit mostly at build-time age while a handful of frequently changing paths stay near-current — which is what makes this affordable on sites with many pages.
- How is this different from rendering the page inside every request?Rendering inside the request makes every visitor wait for data and render work, and the cost scales with views, but each response reflects data at that moment. Refreshing out of band makes nobody wait and scales with refreshes rather than views, and accepts that responses lag the data by up to the refresh window plus the render's own duration.
A newspaper vending box keeps selling this morning's edition while the next one is on the press. Nobody stands at the box waiting for the print run, and whoever buys before the delivery arrives goes home with the older paper.
saying these in an interview costs you the question
- Says the visitor waits while the page is re-rendered.
- Thinks refreshing one page requires rebuilding the whole site.
- Assumes the stored copy is deleted before a new one exists.
- Claims every visitor is guaranteed current data.
- Confuses it with producing fresh HTML on every request.