Overview

Server-side rendering builds the full HTML document on the server for each request. The browser paints content immediately, crawlers receive full markup, and a hydration step then makes the page interactive. Choose it when pages depend on request data such as cookies, auth, or live inventory and must still be crawlable.

Rules

  • Every request costs server time. Cache what can tolerate staleness (CDN s-maxage with stale-while-revalidate), or use ssg or isr for pages that can be minutes or hours old.
  • Next.js App Router renders a route dynamically when it reads request-time APIs such as cookies() or headers(); the Pages Router used getServerSideProps. SvelteKit renders on the server by default.
  • Server and client markup must match, or hydration fails (hydration).
  • Compared with csr, SSR usually improves LCP and indexing but adds server latency.
  • ssg: build-time HTML.
  • csr: browser-built pages.
  • isr: cached pages regenerated in the background.
  • hydration: the step after SSR.
  • nextjs: dynamic rendering rules.
  • astro-ssr: SSR in Astro.