skip to content

Render Modes & Activation

Whether a route's HTML is produced at build, per request, out of band when stale or in streamed pieces, and what the client runs to take it over. Asked because the mode sets freshness and cost.

on this pageshow

explore

questions

30

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?

level: juniorimportance: must knowfreq 70%

answer

  1. freshness traded for first byte
  2. the request is answered from storage
  3. the render happens off the request path
  4. the swap only helps later visitors

basics

~20 s

The 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 s

The 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

for a junior

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.

for a middle

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.

for a senior

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.

for a principal

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.
open as a page

In a meta-framework, what does prerendering a route at build time mean, and what happens when a visitor requests it?

level: juniorimportance: must knowfreq 72%

basics

~20 s

Prerendering at build time runs a route's data loading and render once, during the build, and writes the finished HTML into the build output. Every visitor is then served that same file, with no per-request fetch or render.

open as a page

In a server-rendered route, what is hydration, and what must the browser be handed for it to happen?

level: juniorimportance: must knowfreq 80%

basics

~20 s

Hydration is a server-rendered route's second delivery: after the finished HTML paints, the browser downloads the component code and the data the server rendered with, then attaches behaviour to the existing markup instead of rebuilding it.

open as a page

When a meta-framework renders a route's HTML on the server for every request, what does the browser receive and why does it help?

level: juniorimportance: must knowfreq 82%

basics

~20 s

The browser receives a finished document: the framework matched the URL, ran that route's server-side data work and rendered markup before replying. Content is visible in the first paint, and machines that never run scripts can read it.

open as a page

In a meta-framework that prerenders routes at build time, which inputs make a route's output request-dependent?

level: juniorimportance: must knowfreq 72%

basics

~20 s

Input that arrives with the HTTP request and differs between callers: the cookie jar, request headers, the query string, the caller's address. Reading a database, a config value or a path parameter does not, by itself.

open as a page

Why can a visitor arriving after a prerendered page is considered stale still be served the old HTML, and who gets fresh?

level: middleimportance: must knowfreq 66%

basics

~20 s

Being stale marks a copy as due for refresh; it does not withhold it. The request is still answered from storage, and the fresh HTML first reaches whoever arrives after the out-of-band render has completed and replaced the copy.

open as a page

For a route with a dynamic path segment, how does the build decide which concrete paths to prerender?

level: middleimportance: must knowfreq 62%

basics

~20 s

A dynamic segment has no fixed path list, so the route supplies a build-time enumeration step returning the parameter sets to render — usually a query against the data source that fills the pages. The build emits one page per entry.

open as a page

How do whole-route hydration, islands-only hydration, and shipping no client script differ in what a route downloads?

level: middleimportance: must knowfreq 68%

basics

~20 s

Scope decides the script budget. Whole-route hydration ships the route's entire component tree; islands ship only the parts declared interactive and leave the rest as inert HTML; a no-script route ships none, so only platform behaviour works.

open as a page

Why does a route rendered on the server for each request send nothing to the browser until its data and render finish?

level: middleimportance: must knowfreq 70%

basics

~20 s

The response body is the rendered markup, and markup cannot be produced before the values it prints are known. So the request waits for the route's server data work plus render time, and the first byte carries both of those costs.

open as a page

How does a framework that infers a route's rendering mode differ from one that makes the route declare and enforce it?

level: middleimportance: must knowfreq 58%

basics

~20 s

Inference derives the mode from what the render touched, so a request-bound read silently flips the route and shows up later as cost or staleness. Declaration makes the route state its promise and fails loudly when the render breaks it.

open as a page

In a streamed route response, which parts of a nested route chain can still choose the status code, cookies or a redirect?

level: middleimportance: must knowfreq 57%

basics

~20 s

Only the levels that resolve before the shell is flushed — in practice the outermost ones. Status, headers and cookies leave with the first bytes, so a deferred level can change only the markup in its own region.

open as a page

When a meta-framework streams a route's HTML, what goes out first and how does a slow region's markup reach its place later?

level: middleimportance: must knowfreq 62%

basics

~20 s

The shell goes first: the document frame with a placeholder wherever a region is still pending. As each region resolves, its markup is appended to the same open response, with an inline script that moves it into place.

open as a page

In a model that refreshes prerendered pages out of band, what can a request for a path with no stored copy be given?

level: middleimportance: should knowfreq 48%

basics

~20 s

With nothing stored there is no stale copy to serve. Frameworks take one of two routes: hold the request for a first render and store its output, or answer immediately with a placeholder while the render runs out of band.

open as a page

When a visitor requests a dynamic path that the build never prerendered, what can a meta-framework do with that request?

level: middleimportance: should knowfreq 54%

basics

~20 s

Three behaviours are on offer: answer 404 because the path was not enumerated; render it on the server on first request and usually keep the output; or return a placeholder shell and fill it from the browser.

open as a page

What does deferring a component's hydration until browser idle or first visibility change, and what does it not change?

level: middleimportance: should knowfreq 52%

basics

~20 s

Deferring moves takeover work off the window after paint, and can avoid it for parts never seen. It does not shrink what a hydrated component costs, and it widens the period where a control looks ready but is inert.

open as a page

Why does a route whose HTML is rendered per request cost more server work as its traffic grows?

level: middleimportance: should knowfreq 54%

basics

~20 s

Every view is its own render: one route match, one set of data reads, one tree rendered to a string, one serialisation. That work is repeated per visitor rather than amortised, so compute, upstream load and concurrency all track traffic almost linearly.

open as a page

In a file-based router, does a route with a parameterised path segment have to be rendered per request?

level: middleimportance: should knowfreq 48%

basics

~20 s

No. A parameterised segment makes the URL shape dynamic, not the render. It can be prerendered once per known value, and becomes per-request only when the render reads request-bound input such as a cookie, header or query string.

open as a page

When the out-of-band render of a prerendered page fails, what is served next, and why can that failure go unnoticed?

level: seniorimportance: should knowfreq 45%

basics

~20 s

The last good copy stays in place, because a failed render is not published. Visitors keep getting fast, valid, steadily older HTML with a success status, so only render telemetry and the age of the stored copy reveal that anything is wrong.

open as a page

A stale prerendered page is hit by a burst of requests at once. How many out-of-band renders run, and what do the requests get?

level: seniorimportance: should knowfreq 52%

basics

~20 s

Typically one render per path rather than one per request: implementations keep a single refresh in flight for a path and answer the rest of the burst from the stored copy. Render and data-source load therefore tracks paths refreshed, not traffic.

open as a page

An editor fixes a typo on a page prerendered at build time, but the live site still shows the old text. Why, and what would you put in place?

level: seniorimportance: should knowfreq 50%

basics

~20 s

The deployed page is a file rendered from the data as it stood during the build, and serving it never consults the source. The correction ships when a new build runs and deploys, so publishing needs an automatic rebuild trigger.

open as a page

A mostly-static route downloads nearly as much script as your most interactive route. How would you find out why?

level: seniorimportance: should knowfreq 48%

basics

~20 s

Split the per-route build output into the baseline every route pays and what this route adds. Usual causes: whole-route hydration scope, an interactive element dragging its subtree in, or a shared layout that widens scope for every page beneath it.

open as a page

A per-request rendered page that greets the signed-in user starts showing one person's name to other visitors after a CDN was added. Why, and how do you prevent it?

level: seniorimportance: should knowfreq 50%

basics

~20 s

A shared cache stored one visitor's personalised render and replayed it to everyone matching the same cache key, which is usually method plus URL and ignores the session cookie. Personalised responses must declare themselves uncacheable by shared caches, or vary the key.

open as a page

A prerendered page needs one per-visitor element; what do you gain and lose by rendering that part in the browser instead?

level: seniorimportance: should knowfreq 52%

basics

~10 s

You keep the route static, shared-cacheable and cheap. You pay a waterfall after the bundle loads, an element missing from the initial HTML, layout shift or a wrong-state flash, and a new authenticated endpoint.

open as a page

How does a draft-preview mode let an editor see unpublished content on a route that every visitor otherwise gets prerendered?

level: seniorimportance: should knowfreq 42%

basics

~20 s

An unguessable flag on the editor's request is request-bound input: reading it forces a fresh render, tells the data layer to return drafts, and bypasses stored copies. That response must never be storable by a shared cache.

open as a page

A deferred region of a streamed route fails after the shell was flushed. What reaches the browser, and what does the page report?

level: seniorimportance: should knowfreq 46%

basics

~20 s

A late chunk that swaps the placeholder for the nearest error fallback, on a response that already reported success. The route's whole-page error screen is unreachable, because replacing the document would mean un-sending bytes the browser has parsed.

open as a page

A streamed route defers a section whose data shows the visitor may not see this page, but the shell is already sent. What are your options?

level: seniorimportance: should knowfreq 50%

basics

~10 s

Three, and only one is clean: promote the check above the shell flush so the response can still refuse or redirect; render a denial state in that region; or navigate from the client afterwards.

open as a page

For a route rendered on every request, how do you set policy for what the render does when a data source is slow or unavailable?

level: principalimportance: should knowfreq 38%

basics

~20 s

Decide per data source, not per route: which reads are essential to the page and which are decoration. Essential reads justify holding the response to a bounded deadline then failing; optional ones get a short timeout and render without them.

open as a page

How would you decide, across an application's streamed routes, which work may sit in a deferred region and which must resolve before the shell?

level: principalimportance: should knowfreq 40%

basics

~20 s

Sort route work by what its result can change. Anything that can change the response itself — status, headers, cookies, destination — resolves before the shell; work that only fills a region may be deferred.

open as a page

As the lead, how do you decide which surfaces may serve a stale prerendered copy while a fresh render runs out of band?

level: principalimportance: nice to knowfreq 44%

basics

~20 s

Classify content by the cost of being briefly wrong. Surfaces whose facts tolerate age take the stored copy; prices, availability, permissions and anything personalised do not. The model promises eventual freshness, never current data, so name a worst-case age and measure it.

open as a page

As the lead of a site where most routes prerender at build, how would you govern which routes stay that way as it grows?

level: principalimportance: nice to knowfreq 41%

basics

~20 s

Treat build duration as a budget with an owner. Prerender families whose content changes on the deploy cadence and whose page count is capped to a valuable slice; move per-user, fast-moving and long-tail families to another mode.

open as a page