Skip to the page

Building blocks of a client architecture · senior

Choosing a rendering strategy

Choose rendering per route: static or cached HTML for public, SEO-heavy pages, server streaming for personal or fresh parts, and client rendering for app-like screens behind login. Explain the cost in TTFB, LCP and INP.

The notes

What you must know

  • CSR: an empty HTML shell plus JavaScript; slow first paint on low-end phones; fine behind login (dashboards); weak for SEO and link previews.
  • SSR: HTML per request; good LCP and SEO; TTFB depends on the server and data; hydration can make a page look ready but not respond (web.dev), hurting INP.
  • Static (SSG) and ISR: HTML built ahead or cached and served from a CDN; fastest TTFB; needs revalidation when data changes.
  • Streaming SSR with Suspense: send the shell first, stream slow parts; one slow API no longer blocks the whole page.
  • Next.js 16 Cache Components (on in new apps since 16.4, the default for all in Next 17): Partial Prerendering builds a static shell; 'use cache' with cacheLife/cacheTag caches parts; cookies, headers and searchParams must sit inside <Suspense> and stream at request time.
  • React Server Components send no JavaScript for non-interactive parts, so bundles shrink; client components still hydrate.
  • Example split for e-commerce: home and listing = static shell + cached data + streamed personalisation; product page = cached product + fresh price and stock; cart and checkout = dynamic, never shared-cached.
  • Measure first (web.dev's main advice): pick the strategy that fixes your actual bottleneck.

The red pen

Common traps: mistake → fix

  • Mistake: SSR is always faster

    Fix: slow data makes TTFB worse and hydration can hurt INP.

  • Mistake: Static pages can't have dynamic parts

    Fix: PPR and ISR mix static shells with dynamic holes.

  • Mistake: Caching personalised HTML on the CDN is fine

    Fix: it leaks one user's data to another.

  • Mistake: CSR is dead

    Fix: it is still right for authenticated, app-like screens.

Easy to hard

Questions interviewers ask, easy to hard

  1. CSR vs SSR vs SSG vs ISR: when do you pick each?
  2. Choose rendering for each route of an e-commerce site.
  3. What is hydration and why can it hurt INP?
  4. With Cache Components, where must cookies() be read and why?

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview