
Every web page has to be turned into HTML at some point. The real question is *where* and *when* that happens: on a build server before anyone visits, on a web server for each request, or in the visitor's browser after JavaScript loads. That choice is called your rendering strategy, and it affects how fast pages feel, how well they rank, how much hosting costs and how fresh the content is.
This guide compares server-side rendering (SSR), client-side rendering (CSR), static site generation (SSG) and Incremental Static Regeneration (ISR), and shows how modern frameworks mix them route by route.
The Four Strategies at a Glance
- SSG (static site generation): HTML is generated once, at build time. Every visitor gets the same pre-built file, usually from a CDN. Content only changes when you rebuild and redeploy.
- SSR (server-side rendering): HTML is generated on the server for each request. The page can include fresh or user-specific data, but the server does work on every visit.
- CSR (client-side rendering): The server sends a mostly empty HTML shell plus JavaScript. The browser downloads and runs that JavaScript, fetches data and builds the page.
- ISR (Incremental Static Regeneration): Pages are served as static HTML, but individual pages are regenerated in the background after a set interval or when you trigger it. You get static speed without rebuilding the whole site.
The key distinction between SSR and SSG is timing. SSR renders a page *per request*. If ten people visit, the server renders ten times (unless you add caching). SSG renders *once at build time*, and all ten visitors get the same file.
How Each One Works: The Request Timeline
SSG
- At build time, the framework fetches data and writes an HTML file for every URL.
- The files are uploaded to a CDN.
- A visitor requests a page. The nearest CDN edge returns the ready-made HTML straight away.
- The browser paints the content, then loads any JavaScript needed for interactive parts.
Nothing runs on a server at request time, so static sites are fast, cheap and hard to break.
SSR
- A visitor requests a page.
- The server runs your code, fetches data (from a database, CMS or API) and renders HTML.
- The server sends the complete HTML. The browser paints it.
- JavaScript loads and *hydrates* the page, attaching event handlers so it becomes interactive.
Because rendering happens on each request, the time to first byte (TTFB) depends on how quickly your server and data sources respond.
CSR
- A visitor requests a page. The server (often a CDN) returns a small HTML shell.
- The browser downloads, parses and runs the JavaScript bundle.
- The JavaScript calls APIs for data.
- Only then is the real content rendered into the page.
The first response is fast, but meaningful content appears late, after several round trips and JavaScript execution on the user's device.
ISR
- Pages are generated at build time, or on the first request for that URL.
- Visitors get the cached static version.
- Once the revalidation interval has passed, the *next* request still gets the cached (now stale) page, and a fresh version is generated in the background.
- When regeneration succeeds, the new page replaces the old one for later visitors. If it fails, the last good version keeps being served.
This is the stale-while-revalidate pattern described in the Next.js ISR guide. It also means ISR is not for data that must be correct on every request: someone will always see the previous version for one cycle. For real-time data, use SSR or fetch on the client.
SEO and Core Web Vitals
Search engines
Google can render JavaScript, but it works in phases: crawl, render, index. Pages wait in a render queue before a headless Chromium runs the JavaScript, and that wait "can take longer" than a few seconds, according to Google's JavaScript SEO basics. The same page notes that "not all bots can run JavaScript" and that server-side or pre-rendering "is still a great idea."
In practice:
- SSG, ISR and SSR send complete HTML, so crawlers, social-media link previews and AI search tools see the content immediately.
- CSR depends on the crawler running your JavaScript successfully. It can rank, but it's the riskier choice for public pages that need search traffic.
LCP and INP
Google's Core Web Vitals targets are an LCP (Largest Contentful Paint) of 2.5 seconds or less and an INP (Interaction to Next Paint) of 200 milliseconds or less, measured at the 75th percentile of real page loads (web.dev).
- LCP: SSG and ISR pages usually do best because the HTML already sits on a CDN edge near the user. SSR can be just as good if your server and data are fast, but a slow database query delays everything. CSR tends to struggle, because the largest element can't paint until JavaScript has loaded, run and fetched data.
- INP: This is about how much JavaScript runs in the browser, not where the HTML came from. Large CSR bundles and heavy hydration can block the main thread and make clicks feel sluggish. As web.dev's rendering guide puts it, rehydration "can have a significant negative impact on TBT and INP, even if it improves FCP." Shipping less JavaScript helps every strategy.
Caching, Hosting and Cost
- SSG: Cheapest and simplest. Static files can sit on any CDN or static host, with no server to scale or patch. The cost is build time: a site with tens of thousands of pages can take a long time to rebuild after every content change.
- ISR: Mostly CDN-served, with occasional background regeneration that uses server compute. Next.js notes that on platforms with per-request billing, this background work counts as additional compute. ISR also needs a host that supports it. It doesn't work with a pure static export.
- SSR: You pay for compute on every uncached request, and traffic spikes hit your server and database directly. You can soften this with cache headers on pages that aren't personalised.
- CSR: The app shell is static and cheap to host. The cost moves to your APIs, which handle every data request, and to your users' devices, which do the rendering. Low-end phones feel that most.
Data Freshness
- SSG: As fresh as your last build.
- ISR: Fresh within your revalidation window, or immediately after an on-demand revalidation (for example, a CMS webhook that fires when an editor publishes).
- SSR: Fresh on every request, unless you cache it.
- CSR: Fresh whenever the client fetches. It can also update live without a page reload.
When to Use Each: Concrete Examples
Marketing or company website
Use SSG. Service pages, about pages and landing pages change rarely, need to rank and should load instantly.
Blog or documentation
Use SSG, or ISR if editors publish often from a headless CMS and you don't want a full rebuild for each post. On-demand revalidation triggered by a publish webhook keeps posts current without a short timer.
E-commerce catalogue
Use a mix. Product and category pages suit ISR (or SSG for small catalogues): they need to rank and load fast, and prices or descriptions change periodically. Stock levels that must be exact can be fetched on the client or checked server-side at checkout. Cart, checkout and account pages are personal, so they use SSR or CSR.
Dashboard behind a login
Use CSR, or SSR without caching. Search engines can't see it anyway, the data is user-specific, and the experience is highly interactive. Keep the bundle lean, because INP still matters to your users.
News site
Use SSR with short CDN caching for the homepage and breaking stories. Article pages can then move to ISR with on-demand revalidation for corrections. Use client-side updates for live tickers.
Hybrid Rendering: Choose Per Route
You rarely have to pick one strategy for a whole site. Modern meta-frameworks let each route choose its own.
Next.js (App Router)
Set `revalidate` on a route segment to make it use ISR. Pre-build dynamic routes with `generateStaticParams`:
// app/blog/[slug]/page.tsx
export const revalidate = 60 // regenerate at most once every 60 seconds
export async function generateStaticParams() {
const posts = await getPosts()
return posts.map((post) => ({ slug: post.slug }))
}For on-demand updates, call `revalidatePath('/blog')` or `revalidateTag(...)` from a Server Action or Route Handler. Per the docs, ISR runs only on the Node.js runtime and isn't supported with a static export. Next.js also documents a newer caching model, Cache Components, which has its own ISR guide. Check which model your project uses.
SvelteKit
SvelteKit server-renders and then hydrates by default. Page options change that per route, in `+page.js`, `+page.server.js` or a layout file:
// src/routes/about/+page.js
export const prerender = true // SSG: build this page to static HTML// src/routes/app/+layout.js
export const ssr = false // CSR only: render this section in the browserYou can also set `export const csr = false` to ship a page with no client-side JavaScript at all. That works well for purely static content.
On Vercel, `adapter-vercel` adds ISR through a route's `config` export:
// src/routes/products/[id]/+page.server.js
export const config = {
isr: {
expiration: 60 // seconds before the cached page is regenerated
}
};The adapter docs note that ISR has no effect on a route that also sets `prerender = true`, because that page is already built at build time. A `bypassToken` option supports on-demand revalidation and draft previews. See the SvelteKit page options and Vercel adapter docs.
Nuxt
Nuxt uses universal rendering (SSR plus hydration) by default. `routeRules` in `nuxt.config` sets hybrid rendering per path:
// nuxt.config.ts
export default defineNuxtConfig({
routeRules: {
'/': { prerender: true }, // SSG
'/products': { swr: true }, // cached, revalidated in background
'/blog': { isr: 3600 }, // ISR, CDN-cached for an hour on supported hosts
'/admin/**': { ssr: false } // client-side only
}
})According to the Nuxt rendering docs, `isr` behaves like `swr` but can also cache in the CDN on supported platforms (currently Netlify or Vercel).
Astro
Astro prerenders the whole site by default and strips client-side JavaScript unless you ask for it. Interactive components become *islands* via directives such as `client:load`, `client:idle` or `client:visible`, while the rest of the page stays static HTML. To render a single page on demand, add a server adapter and opt that page out of prerendering:
---
// src/pages/account.astro
export const prerender = false
---`server:defer` creates server islands: dynamic, server-rendered pieces that load in after the static page appears. See Astro islands and on-demand rendering.
Streaming SSR in Brief
Classic SSR waits for all data before sending any HTML. Streaming SSR sends the page in chunks: the layout and fast content first, then slower sections as their data arrives. In the Next.js App Router, a `loading.js` file or a React `<Suspense>` boundary sets where streaming can start. In SvelteKit, returning an un-awaited promise from a server `load` function streams that data to the browser as it resolves.
A few caveats come from the docs:
- Once streaming starts, the status code and headers are fixed.
- SvelteKit buffers the response on platforms without streaming support, such as AWS Lambda or Firebase.
- In SvelteKit, streamed data needs JavaScript enabled.
Put content that matters for SEO and LCP in the first chunk, and stream secondary panels.
Decision Checklist
- Does the page need to rank in search or show rich link previews? Avoid pure CSR. Choose SSG, ISR or SSR.
- Is the content the same for every visitor? Prefer SSG or ISR. If it's personalised, use SSR or CSR.
- How often does it change? Rarely: SSG. Every few minutes to hours, or on publish: ISR with on-demand revalidation. Must be correct on every request: SSR, or client-side fetching for that part.
- How many pages? Thousands of pages with frequent edits point to ISR rather than full rebuilds.
- Is it behind a login? CSR or uncached SSR is fine. SEO is irrelevant there.
- How interactive is it? Heavy interactivity favours CSR or islands. Watch bundle size for INP either way.
- What does your host support? ISR and streaming need platform support. A plain static host can only serve SSG and CSR.
- What's your budget for compute? SSG and ISR keep server costs low. Uncached SSR scales cost with traffic.
How Tech Inject Approaches It
Most sites we build are hybrid: static or ISR for public pages, SSR or CSR only where data is personal or live. If you want a marketing site that loads fast and is simple to host, see our premium static websites. For catalogues, portals and apps that need SSR, APIs or dashboards, see our web development services.
Sources
- web.dev, Rendering on the Web (definitions of SSR, static rendering, CSR, hydration and streaming; TTFB/INP trade-offs)
- web.dev, Web Vitals (LCP ≤ 2.5 s, INP ≤ 200 ms, CLS ≤ 0.1 at the 75th percentile)
- Google Search Central, Understand the JavaScript SEO basics
- Next.js, How to implement Incremental Static Regeneration (ISR)
- Next.js, loading.js (streaming with Suspense, status codes)
- SvelteKit, Page options
- SvelteKit, Vercel adapter (ISR configuration)
- SvelteKit, Loading data (streaming with promises)
- Nuxt, Rendering modes (route rules and hybrid rendering)
- Astro, Islands architecture and On-demand rendering
Frequently Asked Questions
The difference is when the HTML is generated. With server-side rendering (SSR), the server builds the page for each incoming request, so it can include fresh or user-specific data. With static site generation (SSG), pages are built once at build time and the same file is served to every visitor. That is very fast and cheap to host, but the page only changes when you rebuild.
It can be a disadvantage. With client-side rendering, the browser receives a mostly empty HTML shell and JavaScript builds the content afterwards. Search engines can render JavaScript, but it is slower and less reliable than reading ready-made HTML, and the first meaningful paint for users is often delayed. For public pages that need to rank, SSR or SSG is usually the safer choice.
Incremental Static Regeneration serves statically generated pages but regenerates them in the background after a set interval or when content changes, without rebuilding the whole site. Visitors get static-page speed while content stays reasonably current. It suits catalogues, blogs and listings that change periodically. For data that must be up to date on every request, SSR is a better fit.
Most e-commerce sites mix approaches. Product and category pages often use SSG or ISR so they load quickly and rank well while still picking up price and stock changes, and stock or pricing can be refreshed on the client. Cart, checkout and account pages are personalised, so they typically use SSR or client-side rendering. Frameworks like Next.js and SvelteKit let you choose per route.
Yes, generally. With CSR, the server mainly delivers static HTML, CSS and JavaScript files, often from a CDN, and the browser does the rendering work, so the server only handles data API calls. The trade-off is more work on the user's device and a slower first view, especially on low-end phones. That's why public pages often combine CSR with SSR or SSG.








