EasyRendering Strategies📖 Theory Question

What is the difference between CSR, SSR, SSG, and ISR?

💡

Hint

Where and when HTML is generated — client, server on request, server at build time, or server with revalidation

Full Answer

These are four strategies for deciding where and when HTML is produced.

CSR (Client-Side Rendering) — the server sends a bare HTML shell; JavaScript downloads and renders everything in the browser. Fast TTFB, slow FCP, poor SEO.

SSR (Server-Side Rendering) — HTML is generated on the server per request. Good SEO and fast FCP but higher TTFB under load; server must run Node.

SSG (Static Site Generation) — HTML is generated once at build time and served as a static file from a CDN. Fastest possible delivery; stale for frequently changing data.

ISR (Incremental Static Regeneration) — SSG pages are regenerated in the background after a revalidate interval (Next.js). First visitor after expiry may see stale content while rebuild happens.

// Next.js ISR example
export async function getStaticProps() {
  const data = await fetchData();
  return {
    props: { data },
    revalidate: 60, // regenerate at most once per 60s
  };
}
💡 Interview framing: choose based on how often data changes (SSG for rarely, ISR for periodically, SSR for per-request, CSR for fully private/auth-gated).

More Rendering Strategies Questions

EasyWhen would you choose SSR over SSG for a page?EasyWhat is Streaming SSR and how does it improve perceived performance?EasyWhat is hydration and what causes hydration mismatches?MediumWhat is partial hydration / islands architecture and why does it matter?

Practice this in a timed sprint →

5 free questions, no signup required

⚡ Start Sprint