Appearance

Visual style

Mode
Theme
Accent
Advanced
Text sizeScales the whole site
16 px
Reduce motionReduce animations or match your system
Separate light and darkChoose a theme, accent and font for each
50

Next.js & React

SSG, SSR or ISR? Choosing a rendering strategy for each route

What SSG, SSR, ISR and client-side rendering mean, what each costs, and how I choose per route across real Astro and Next.js projects.

Render a page at build time (SSG) when everyone sees the same content and it changes rarely; regenerate it periodically or on demand (ISR) when the content changes but not per visitor; render on each request (SSR) only when the page depends on who is asking or must be current to the second; and render in the browser (CSR) only for interactive parts behind a login. Choose per route, not per project.

The four strategies

StrategyHTML producedBest forMain cost
SSG: static site generationOnce, at build timeMarketing pages, docs, catalogues, case studiesContent changes need a rebuild
ISR: incremental static regenerationAt build, then refreshed after a time window or on demandLarge catalogues, listings, content edited during the dayBriefly stale pages; platform support needed
SSR: server-side renderingOn every requestPersonalised pages, carts, dashboards needing fresh server dataServer work per request; slower time to first byte than a cached file
CSR: client-side renderingIn the browser, after JavaScript loadsHighly interactive app views behind a loginEmpty initial HTML; slower first render; poor for SEO

What’s the difference between SSR and SSG? Both send complete HTML to the browser, which is what search engines and answer engines read. The difference is when that HTML is produced: SSG produces it once during the build and serves the same file to everyone; SSR produces it fresh on every request, so it can depend on the visitor, but it costs server work every time.

The decision rules I use

  1. Does the page differ per visitor? If yes, it needs SSR or client rendering for the personalised part. If no, keep going.
  2. How often does the content change? Rarely: SSG. Throughout the day, but the same for everyone: ISR, or SSG plus a rebuild triggered by content changes.
  3. Does it need to rank or be shared? Then the content must be in the initial HTML, which rules out client-only rendering for that content.
  4. How much interactivity? Add it as islands or Client Components on top of server-rendered HTML; don’t make the whole page client-rendered to get one interactive widget.

How this plays out in real projects

Brand and business websites: static. Eastern Condiments (520 pages), Venora Dubai, ORVAS and this portfolio are fully static Astro sites. Content is the same for everyone and changes when someone edits it, so a rebuild on change is simpler and faster than any server rendering. The HTML is complete from the first byte, and the only JavaScript is for motion and a few interactive components.

A data-driven documentary: static Next.js. Rich Anthill is a Next.js App Router site where every route is prerendered at build time, then deployed to Cloudflare Workers with OpenNext. Adding a day’s episode means adding a validated JSON file and rebuilding; the homepage, archive, sitemap and share images all regenerate. Next.js was chosen for its tooling, not for server rendering.

Dashboards: server data, client interactivity. The Ekonavi marketplace’s seller dashboard is personal to each seller and changes constantly. Static rendering is irrelevant there. Data comes from Hasura GraphQL and is cached in the browser with TanStack Query, so navigation between views is fast and lists refresh in the background. Search-engine visibility doesn’t matter behind a login.

Mixed products: per route. A typical product has public pages that should be static, catalogue pages that suit ISR, and account pages that need SSR or client data. The App Router lets each route choose; the mistake is letting the most dynamic route dictate the strategy for all of them.

Common mistakes

  • Making everything SSR “for SEO”. Static HTML is just as crawlable, faster and cheaper. SSR is for freshness or personalisation, not for search engines.
  • Client-rendering public content. If the HTML is an empty shell until JavaScript runs, some crawlers and AI systems will see nothing, and every visitor waits longer.
  • Forgetting cache behaviour on the target platform. Revalidation and caching depend on the hosting platform and its adapter. Running Next.js on Cloudflare Workers through OpenNext, test caching on the real deployment, not just locally.
  • Hydrating a whole page for one widget. Use islands (Astro) or a small Client Component (Next.js) for the interactive part.

A quick reference

PageStrategy
Home, services, about, case studies, articlesSSG
Product or property listings updated dailyISR or SSG with rebuild on content change
Product detail with live stockSSG page + client-fetched stock widget
Cart, checkout, accountSSR or client-rendered behind auth
Admin and seller dashboardsClient-rendered views over a cached API

References

  1. Next.js: rendering nextjs.org
  2. Next.js: incremental static regeneration nextjs.org
  3. Astro: on-demand rendering docs.astro.build
  4. web.dev: rendering on the web web.dev

Working on something like this?

If this article maps to a problem in your own product, send me a short note about it. I'm happy to give a second opinion.