Next.js App Router: When to Use SSR, SSG or ISR

Next.js App Router: When to Use SSR, SSG or ISR

Static, dynamic or revalidated: a decision guide for every page type in a real Next.js product.

The App Router makes rendering a per-route decision instead of a project-wide one. Picking the right mode for each page is one of the easiest performance wins in Next.js.

Static by default

If a page's data is the same for every visitor, render it at build time. Marketing pages, blog posts and documentation should be static: they are served from the edge and cost almost nothing.

Revalidate when data changes slowly

A catalog that changes a few times a day does not need to render on every request. Set a revalidation window and Next.js regenerates the page in the background.

// app/catalog/page.tsx
export const revalidate = 300; // seconds

export default async function Catalog() {
  const products = await getProducts();
  return <ProductGrid products={products} />;
}

Dynamic when the request matters

Dashboards, carts and anything that reads cookies or headers must render per request. Reading cookies() or headers() opts the route into dynamic rendering automatically.

A quick decision table

  • Same for everyone, rarely changes: static.
  • Same for everyone, changes hourly or daily: static with revalidate.
  • Depends on the user or request: dynamic.
  • Mostly static with one personal widget: static page plus a client component that fetches the personal part.

Watch the root layout

Reading cookies in the root layout makes every route dynamic. Keep request-specific logic as low in the tree as you can so the rest of the site stays static.

More on this topic

Photography
3D Models
Development
Illustrations
Fashion
Digital Art
Packaging
Motion
Illustrations
Video Production
Photography
3D Models
Development
Illustrations
Fashion