What Is Server-Side Rendering?

Server-side rendering (SSR) generates a page's full HTML on the server for each request, so the browser receives complete, visible markup immediately rather...

Published October 8, 2026

Server-side rendering (SSR) generates a page's HTML on the server for each request and sends it ready to display, instead of shipping an empty shell for JavaScript to fill in. It speeds up first paint and helps SEO.

The concept

The server runs your UI code, fetches data, produces HTML and sends it. The browser shows it immediately, then JavaScript hydrates the page to make it interactive.

Cost: the server does more work per request and must be kept running, unlike static files on a CDN.

Timeline

  1. Browser requests /product/7
  2. Server fetches data and renders HTML
  3. Browser paints the page immediately
  4. JS downloads and hydrates for interactivity

Practical examples

Next.js server component

export default async function Page({ params }) {
  const p = await db.product(params.id)
  return <h1>{p.name}</h1>
}

Express + template

app.get('/', (req, res) => res.render('home', { items }))

Caching SSR output

Cache-Control: public, s-maxage=60, stale-while-revalidate=300

Common mistakes

  • SSR for pages that never change (use static generation).
  • No caching in front of an SSR server.
  • Hydration mismatch from non-deterministic markup.

Key takeaways

  • HTML rendered on the server per request.
  • Good for SEO and fast first view.
  • Cache aggressively.

FAQ

SSR vs SSG?

SSG renders once at build time; SSR renders per request.

Does SSR need Node?

A server runtime is required, though edge runtimes exist.

More JavaScript articles