Skip to content

๐Ÿ—๏ธ Rendering Strategies - SSR, SSG, & ISR

Donโ€™t ask โ€œwhich framework is best?โ€ Ask โ€œWhen does the HTML get generated?โ€ A Programmer chooses the strategy that minimizes the work the userโ€™s browser has to do, balanced against how frequently the data changes.


The server generates the full HTML for every request.

  • Frameworks: Next.js (getServerSideProps), Nuxt (useAsyncData), Remix (Loaders).
  • Pros: Dynamic data is always fresh; excellent for SEO; fast โ€œFirst Contentful Paintโ€ (FCP).
  • Cons: Higher server load; slower โ€œTime to First Byteโ€ (TTByte) compared to static files.
  • The โ€œHydrationโ€ Cost: After the HTML arrives, the browser still has to download and execute JS to make the page interactive.

The HTML is generated once at build time and served as static files via a CDN.

  • Frameworks: Next.js (getStaticProps), Nuxt (Static target), Astro.
  • Pros: Extreme performance (serving raw HTML from a CDN edge); zero server cost at runtime; highly secure.
  • Cons: Build times can explode if you have 100k+ pages; data is โ€œstaleโ€ until the next build.

The โ€œHoly Grailโ€ for large-scale sites. It allows you to update static pages after youโ€™ve built the site, without needing a full rebuild.

  • How it works: You serve a static page. After a background timeout (revalidate period), the next request triggers a rebuild of just that specific page in the background.
  • Use Case: An e-commerce site with 50,000 products. You donโ€™t want to build all 50k pages every time, but you want price updates to reflect within 60 seconds.

โš–๏ธ Strategic Comparison: Next.js vs. Nuxt vs. Remix

Section titled โ€œโš–๏ธ Strategic Comparison: Next.js vs. Nuxt vs. Remixโ€
FeatureNext.js (React)Nuxt (Vue)Remix (React)
Philosophyโ€The Vercel Wayโ€: Optimized for DX and edge deployment.โ€The Vue Wayโ€: Highly modular and developer-friendly.โ€The Web Standards Wayโ€: Focus on native browser APIs (Forms, Fetch).
Data FetchingServer Components (RSC) & Actions.Auto-imported composables & integrated Nitro server.Loaders and Actions (focused on mutations).
CachingAggressive, complex caching built into the router.Flexible caching per route or component.Relies heavily on HTTP Cache headers.
Best ForLarge-scale enterprise & e-commerce.Vue-based ecosystems & rapid prototyping.Data-heavy dashboards & form-heavy apps.

This is a paradigm shift. Unlike traditional SSR, RSCs never send JavaScript to the client.

  • Programmerโ€™s Move: Use RSCs for the heavy lifting (fetching data from a DB, heavy markdown parsing) and only use โ€œClient Componentsโ€ for interactivity (buttons, forms). This drastically reduces your JS bundle size.

Running your SSR logic on CDN nodes (like Cloudflare Workers or Vercel Edge) instead of a central server.

  • Benefit: Reduces the physical distance between the server and the user, bringing SSR speeds closer to SSG speeds.

In many SSR apps, Component A waits for data, then renders Component B, which then fetches its own data.

  • Solution: Use Parallel Data Fetching (fetching all data at the top level) or Streaming SSR (sending parts of the UI to the client as they become ready using <Suspense>).

๐Ÿ’ก Note: Beware of โ€œOver-hydration.โ€ If you have a static blog post with a single โ€œLikeโ€ button, donโ€™t ship 200kb of React just to make that button work. Consider โ€œIslands Architectureโ€ (Astro) or โ€œResumabilityโ€ (Qwik) to keep the client-side JS near zero.