skip to content

Rendering Strategy Trade-offs

Choosing client, server, prerendered, regenerated or streamed rendering per page type, weighing hydration cost, islands and what crawlers see. Interviewers expect choices defended on SEO and latency.

on this pageshow

questions

6

When designing an online store's frontend, which rendering mode would you give the home, category, product, search, cart, checkout and order-history pages, and why?

level: middleimportance: must knowfreq 68%

answer

  1. decide per page type, not per app
  2. freshness, personalisation, indexing, latency
  3. same for everyone and indexed: HTML made ahead
  4. unbounded URLs cannot all be built ahead
  5. signed-in and never indexed: browser can render

basics

~20 s

Assign a mode per page type from four inputs: freshness, personalisation, indexing and latency. Home, category and product pages get prerendered HTML regenerated on change; search renders per request; cart, checkout and order history render in the browser.

solid answer

~50 s

I decide per page type by asking four things: how often the content changes, whether it differs per visitor, whether it must be indexed and previewed, and what latency target it carries. Home, category and product pages are the same for every visitor, must be found in search and carry the LCP target, so they get HTML prerendered ahead and regenerated when the catalogue changes; per-visitor bits such as recommendations load in the browser afterwards. There are too many products to build them all up front, so the long tail is rendered on first request and then kept. Search results have unbounded URLs, so they render per request on the server. Cart, checkout and order history are personal, never indexed and interaction-heavy, so they render in the browser behind sign-in and never enter a shared cache. The cost is running several modes, whose seams need an owner.

go deeper

for a junior

Recall the main modes - client, server per request, prerendered, regenerated, streamed - and one page type in a store that suits each.

for a middle

Explain the four inputs and walk a store's page types through them, naming why the rejected mode fails freshness, personalisation, indexing or latency.

for a senior

Show the close calls - category, search, checkout - and the costs of the mix: two render paths, a staleness window that cart and checkout must not trust, and seams that need an owner.

for a principal

Frame the mode table as a default the whole organisation reuses, with the inputs as the reason to depart, and weigh uniformity against fitting each page type.

## The modes on the table A **rendering mode** answers one question: *when, and where, is a page's HTML produced?* Five answers matter in a design round: - **Client rendering** - the server sends a nearly empty document plus script; the browser fetches data and builds the page. - **Server rendering per request** - the server builds full HTML for each request, so the first response already carries the content. - **Prerendering at build** - HTML for each URL is produced ahead of time and served as a file, often from a CDN. - **Prerendering with regeneration** - prerendered HTML that is rebuilt later, on a timer or on a change event, without a full redeploy. - **Streaming** - a server-rendered response sent in chunks, so the top of the page leaves before a slow region is ready. Most real applications use several of these at once. Published guidance on rendering says so plainly: you can render some pages on the server and not others, and pages that need personalisation are the classic case static rendering handles badly. ## The four inputs Ask these questions of every page type, in this order: 1. **Freshness** - how often does the content change, and how stale may a visitor see it? 2. **Personalisation** - is the HTML the same for every visitor, or does it depend on who is asking? 3. **Indexing and previews** - must search engines and link previews see the content in the first response? 4. **Latency target** - which page carries the business's loading target, for example LCP within 2.5 s at the 75th percentile? ## A mode for each page type | Page type | Changes | Per visitor? | Indexed? | Mode | Main reason | |---|---|---|---|---|---| | Home | daily campaigns | partly | yes | prerendered, regenerated on publish | shared content, LCP target | | Category listing | stock and price, hourly | no | yes | prerendered, regenerated on catalogue change | indexed, high traffic | | Filtered category view | per filter set | no | mostly no | server per request | too many combinations to build | | Product detail | edits, price changes | no | yes | prerendered, regenerated; long tail on first request | indexed, LCP target | | Search results | per query | no | usually no | server per request | unbounded URLs | | Cart | every click | yes | no | client | personal, interactive | | Checkout | per step | yes | no | client | personal, never cached | | Order history | per order | yes | no | client | signed-in only | | Help-centre article | rarely | no | yes | prerendered at publish | almost static | | Seller analytics dashboard | live | yes | no | client | an interactive tool | The per-visitor parts of shared pages - a greeting, recommendations, the cart count - load in the browser after the shared HTML arrives, so the shared copy never carries one shopper's data. ## Where the choices are close - **Category pages** could render per request with an HTML cache in front. That gives fresher stock at the cost of server work on every cache miss; regeneration on a catalogue event usually gives the same freshness more cheaply. - **Search results** could be client-rendered if search is only reached from the in-app box. Rendering on the server wins when people share or bookmark result URLs and expect results in the first response. - **Checkout** could render per request on the server; it is personal either way. What matters is that no copy of it ever lands in a shared cache. - **A slow region on a per-request page**, such as recommendations on search results, is a reason to stream rather than to change the whole page's mode. ## What the plan costs - **More than one render path.** Shared components such as the header and product card must render on the server and in the browser. - **A staleness window.** Regenerated pages can show the previous price until the rebuild lands, so the cart and checkout must re-read prices from the API rather than trust the page. - **Seams between modes.** Moving from a prerendered product page into a client-rendered cart crosses a boundary someone has to design. - **Server cost** for every per-request page, which grows with traffic. ## Saying it in the round State the four inputs first, then walk the table row by row, naming the rejected alternative and why it fails a stated constraint. An interviewer is grading the reasoning, not whether you picked their favourite mode.

  • Merchandising now wants a price change visible on product pages within a minute. What changes in your plan?
    Keep product pages prerendered, but regenerate them on a price-change event instead of on a timer, so the rebuild starts within seconds of the edit. Treat the price in the HTML as display only: the cart and checkout always re-read the price from the API. If even a minute of drift is unacceptable, render the price region in the browser from a live call and leave the rest of the page prerendered.
  • Why not render every page per request on the server and keep one mode?
    It works, but home, category and product pages are identical for every visitor, so you would repeat the same render and data reads on every hit and pay server cost and first-byte time for nothing. Prerendered HTML served from a CDN gives a fast first byte and early content for those pages. One mode is simpler to operate; it is not cheaper or faster for this traffic mix.
  • When would you client-render the category page instead?
    When it no longer needs to be found by search: for example, a wholesale catalogue that only signed-in trade buyers can open, with prices per buyer. Then it is personal and unindexed, and client rendering behind sign-in is a reasonable choice. The inputs changed, so the mode changes with them.

  • One rendering mode for every page of the store fits all of them
  • Prerender the cart and checkout like the product pages
  • Client-rendered pages cannot be indexed by any search engine
  • Prerender every product and every filter combination at build time
  • Per-request server rendering always gives the fastest first byte
open as a page

Why might an online store's client-rendered product pages reach one search engine's index late and another's not at all, and what would you change?

level: middleimportance: should knowfreq 52%

basics

~20 s

The first response is an empty shell, so content appears only after the crawler's deferred render succeeds, and crawlers that run no script never see it. Server-render or prerender the indexable page types; keep client rendering for personal ones.

open as a page

When designing an online store's frontend, which page types would you ship as server HTML with a few hydrated islands, and which need the whole page hydrated or client-rendered?

level: seniorimportance: should knowfreq 41%

basics

~20 s

Mostly static pages with local interactivity, such as product detail and help articles, become server HTML with islands, cutting their script. Checkout and the seller dashboard, one interactive surface with shared state, keep full hydration or client rendering.

open as a page

An online store prerenders its catalogue and help pages but client-renders cart, checkout and order history; what seams does that mix create, and how would you design them?

level: seniorimportance: should knowfreq 38%

basics

~10 s

Mixing modes creates seams: shopper data on shared pages, navigation between render paths, status codes from a client-rendered area, protection of account data, and builds of different ages. Each seam needs an explicit design.

open as a page

An online store's product page moved from client rendering to per-request server rendering: LCP fell from 3.8 s to 2.3 s, but TTFB rose from 0.2 s to 1.1 s. Is that a good trade, and what next?

level: seniorimportance: should knowfreq 46%

basics

~20 s

Mostly yes: LCP is what shoppers feel and TTFB is not a Core Web Vital, but 1.1 s leaves little margin under the 2.5 s LCP target. Shared product HTML should be prerendered and regenerated to win both.

open as a page

As frontend lead for an online store whose page types belong to five teams, what default rendering policy would you set, and what must a team show to depart from it?

level: principalimportance: nice to knowfreq 35%

basics

~20 s

Set a default per class of page: shared public pages prerendered and regenerated with islands, per-request rendering for request-dependent content, client rendering for signed-in tools. A departure needs field data tied to a changed input.

open as a page