SSR, SSG and ISR
Three ways to render pages: on every request (SSR), once at build time (SSG), or at build time and refreshed later (ISR).
Server-side rendering builds HTML per request, so it is always fresh and costs compute every time. Static site generation builds HTML once and serves files from a CDN, fast and cheap until content changes. Incremental static regeneration serves the static page and rebuilds it in the background after a set time or on demand. Streaming SSR sends the HTML in chunks, so the top of the page shows before slow data arrives.
Related terms
- Hydration: The step where JavaScript in the browser attaches to server-rendered HTML and makes it interactive.
- React Server Components (RSC): React components that run only on the server, send rendered output instead of JavaScript, and can read data directly.
- Static site: A website served as ready-made files (HTML, CSS, images) with no server code or database running per visit.
