Home/ Blog /SEO

SSR vs SSG: Choosing a Rendering Strategy for SEO

Turan Doğan
Turan Doğan
SEO & GEO Specialist
SEO April 28, 2026 16 min read
SSR vs SSG: Choosing a Rendering Strategy for SEO
SUMMARY
Using SSR or SSG is a rendering strategy that serves complete HTML to search engine bots on JavaScript-dependent web applications, securing indexing speed and crawl efficiency. Server-side rendering generates the HTML on every request, while static site generation generates it at build time.

SSR (Server-Side Rendering) means the HTML output is built on the server for every user request and then sent to the client. As of 2026, on JavaScript-heavy sites, using SSR or SSG shortens Googlebot's indexing time by an average of 70%. The root of this performance gap lies in the bottleneck of the bot's render queue and the latency in the request-response cycle.

The Core Problem Between Client-Side Rendering and Search Engine Bots

Client-Side Rendering (CSR) requires page content to be built in the browser by executing JavaScript. When a user opens the URL, the server returns an almost empty HTML skeleton. The real content is added to the DOM only after the JavaScript files are downloaded and executed. In modern browsers this takes milliseconds, but for a bot the cost is a different story entirely.

Googlebot follows a two-stage process when it crawls a page. In the first stage, the raw HTML is downloaded and the basic text content is read. In the second stage, JavaScript is executed and dynamically generated content is rendered. This second stage depends on the render queue and, depending on how busy the queue is, can stretch from hours to days. As a result, critical content served with CSR remains invisible during the bot's first crawl pass. This delay directly affects indexing speed and, in turn, ranking performance.

How SSR Architecture Works

SSR means the HTML is fully built on the server for every HTTP request and sent to the client. The bot or browser sees the complete page content as HTML in the response it receives from the server. There is no need to execute JavaScript. This approach guarantees that the bot reads all of the content on its first crawl pass.

In Next.js, SSR is implemented with the getServerSideProps function. This function runs on the server for every request, fetches the required data and renders the page as complete HTML:

    
export async function getServerSideProps(context) {
  const data = await fetch('https://api.example.com/products');
  const products = await data.json();
  return { props: { products } };
}
    

In Nuxt.js, asyncData (or the useAsyncData composable in Nuxt 3) serves the same purpose. In both frameworks, when the server receives a request it fetches the data, renders the component and returns a complete HTML response.

How SSG Architecture Works

SSG (Static Site Generation) means pages are generated in advance at build time and served as static HTML files. Its key difference from SSR is that the HTML is produced only during the build, not on every request. This approach requires no runtime processing on the server, and pages can be served directly from a CDN.

In Next.js, SSG is implemented with the getStaticProps function:

    
export async function getStaticProps() {
  const data = await fetch('https://api.example.com/posts');
  const posts = await data.json();
  return { props: { posts }, revalidate: 3600 };
}
    

The revalidate parameter here activates the ISR (Incremental Static Regeneration) mechanism. Once the specified period (in seconds) has passed, the first incoming request regenerates the page in the background. So the perception that SSG "can't be updated because it's static" is wrong. ISR keeps the performance advantage of SSG while keeping content fresh.

Performance and Scalability Differences Between SSR and SSG

Because SSR requires server-side processing on every request, it increases server load. On a high-traffic site, thousands of SSR requests per second can strain the backend infrastructure. SSG, on the other hand, completes all the work at build time, so server load at runtime is close to zero. Static files are served from CDN edge locations and the TTFB (Time to First Byte) value drops dramatically.

The limit of SSG, however, is build time. On an e-commerce site with 100,000 product pages, generating every page at build time can stretch the build to hours. This is where ISR or on-demand revalidation comes in. Frequently updated pages are managed with ISR, while pages that rarely change remain fully static. From an SEO standpoint, there is no indexing difference between SSR and SSG; both serve complete HTML to the bot. The decision should be based on the balance between server load, content freshness and build time.

Googlebot's Render Queue and the WRS Mechanism

Googlebot performs JavaScript rendering on a separate infrastructure called the Web Rendering Service (WRS). WRS is based on headless Chromium and uses an up-to-date version of Chrome. But the render queue is not unlimited. In an ecosystem where billions of pages need to be rendered, every page is queued and rendered when its turn comes.

The delay introduced by this queue is a direct SEO risk. When a page served with CSR is published, the bot sees only JavaScript references and an empty HTML skeleton on its first pass. The content is read only on the second pass, after it has gone through the render queue. Days or even weeks can pass between these two passes. With SSR or SSG, the bot receives the full content on the first pass and does not need the render queue at all. This difference is especially critical for news sites and content that needs to be indexed quickly.

Hydration and Its Hidden Impact on SEO

Hydration is the process of making server-rendered static HTML interactive on the client with JavaScript. A page produced with SSR or SSG reaches the browser as complete HTML. Then the JavaScript files are downloaded and parsed, and event listeners are attached to the elements in the DOM. Until this process finishes, the page is visible but not interactive.

Hydration delay directly affects the INP (Interaction to Next Paint) and FID (First Input Delay) metrics. In applications with large JavaScript bundles, hydration can take 2–5 seconds. During that time, a user who clicks a button gets no response. Another SEO risk of hydration delay is that the DOM gets rewritten during hydration. If the HTML rendered on the server differs from the HTML hydrated on the client (a hydration mismatch), the browser rebuilds the DOM, which increases CLS (Cumulative Layout Shift).

Partial Hydration and Island Architecture

Traditional hydration makes the entire page interactive with JavaScript. But the headings and paragraphs of a blog post don't need any interactivity; only the comment form or share buttons need JavaScript. Partial hydration hydrates only the interactive components and eliminates unnecessary JavaScript weight.

The Astro framework applies the island architecture approach natively. Static HTML is the default rendering method; JavaScript is loaded only for components marked with the client: directive. This approach can reduce the total JavaScript bundle size by 60–80%. From an SEO perspective, less JavaScript both lowers TTFB and keeps hydration delay to a minimum. Both the bot and the user win.

Streaming SSR and Progressive HTML Delivery

In traditional SSR, the server waits until the entire page is rendered and then sends it in one piece. Streaming SSR sends the HTML in chunks, shortening the time it takes for the first byte to reach the client. The renderToPipeableStream API introduced with React 18 supports this approach natively.

The Next.js App Router implements streaming SSR through loading.js files and React Suspense components. The top of the page (header, title, first paragraph) is sent immediately; data-dependent components slot into place in the stream as soon as they are ready. From the bot's perspective, streaming SSR produces the same final HTML as traditional SSR. The TTFB metric, however, improves significantly, because the first byte is sent before server processing has finished.

The SEO Impact of the Next.js App Router and Server Components

The App Router introduced in Next.js 13 is built on the React Server Components (RSC) architecture. Server Components run on the server and send no JavaScript to the client at all. These components are rendered as complete HTML and require no hydration on the client. Client Components are used for parts that need interactivity, and only those components are hydrated.

This separation offers a critical SEO advantage. Content rendered with Server Components is fully visible on the bot's first pass, has zero JavaScript dependency and reduces page size. The "use client" directive should be used only in components that truly need interactivity. A common mistake is defining every component as a Client Component; in that case the performance and SEO advantages of Server Components are lost entirely.

Nuxt.js Rendering Modes and SEO Configuration

Nuxt.js lets you configure the rendering mode flexibly in the nuxt.config file. In Nuxt 3, the routeRules feature makes it possible to define different rendering strategies for different URL patterns:

    
export default defineNuxtConfig({
  routeRules: {
    '/blog/**': { prerender: true },
    '/products/**': { ssr: true },
    '/dashboard/**': { ssr: false }
  }
})
    

In this configuration, blog pages are generated statically at build time (SSG), product pages are rendered on the server for every request (SSR), and dashboard pages are rendered only on the client (CSR). Areas that don't need SEO, such as a dashboard, can be left as CSR. However, every page that needs to appear in search results should be configured for SSR or SSG. This hybrid approach applies the most suitable rendering strategy to each page type, maximizing both performance and indexing efficiency.

The SEO Advantages of Gatsby and Static Site Generators

Gatsby is a React-based static site generator and, by default, produces every page as HTML at build time. Its GraphQL-based data layer pulls data from different sources (CMS, API, markdown) and injects it into pages during the build. When the generated static files are served from a CDN, TTFB can drop below 50 ms.

Gatsby's SEO advantage is that the bot receives complete HTML with no JavaScript dependency. But on large sites, build time is a serious bottleneck. A 50,000-page Gatsby project can push build time past 30 minutes. Gatsby Cloud and DSG (Deferred Static Generation) offer a partial solution to this problem; in terms of scalability, however, Next.js's ISR mechanism is a more flexible alternative.

Angular Universal and Vue SSR Integration

In the Angular ecosystem, SSR is provided through the Angular Universal module. The @nguniversal/express-engine package server-side renders Angular components on an Express.js server. The hydration improvements introduced in Angular 17 have largely resolved the performance issues of earlier versions.

In the Vue.js ecosystem, outside of Nuxt.js, SSR with vanilla Vue is possible through the vue-server-renderer package. But this approach requires manual configuration for routing, data fetching and state management. For Vue-based projects, using Nuxt.js significantly simplifies SSR/SSG configuration and lowers the chance of errors.

A Migration Strategy From CSR to SSR/SSG

Converting an existing CSR project to SSR or SSG is more complex than writing one from scratch. The migration requires moving the data fetching layer to the server, isolating code that depends on browser APIs (window, document, localStorage) and making the routing structure compatible with the framework's SSR mechanism.

Our hands-on experience in the field shows that the most efficient migration strategy is a gradual one. In the first phase, only SEO-critical pages (home page, product pages, blog posts) are moved to SSR. In the second phase, the remaining pages are converted. In the third phase, performance optimization and hydration improvements are carried out. The ability of Next.js's Pages Router and App Router to run side by side stands out as a powerful feature that supports this gradual migration.

Testing Content Visibility With JavaScript Disabled

The simplest way to test whether SSR or SSG is working correctly is to load the page with JavaScript disabled. In Chrome DevTools, turn off JavaScript via F12 > Settings (F1) > Debugger > Disable JavaScript and reload the page. If the title, main text, images and navigation are visible, SSR/SSG is working correctly.

The key point in this test is to check not only the main content but also the structured data and meta tags. When you inspect the page source with view-source:, the <script type="application/ld+json"> blocks and <meta name="description"> tags should appear in the HTML. If these elements are injected with JavaScript, the bot cannot see them on its first pass. In an SSR/SSG setup, structured data and meta tags must be rendered on the server.

Dynamic Rendering and Bot Detection

Dynamic rendering means detecting bot requests and serving pre-rendered HTML only to bots, while regular users get the CSR experience. Google has described this approach as a workaround and does not recommend it as a long-term strategy. Tools such as Prerender.io and Rendertron are used to implement it.

The main risk of dynamic rendering is that it can be confused with cloaking. Serving different content to bots and users violates Google's guidelines. Serving the same content through different rendering methods, however, is accepted by Google. Even so, dynamic rendering adds infrastructure complexity, creates a separate layer whose render cache must be kept up to date, and builds up technical debt, since a move to SSR/SSG is inevitable in the long run. For new projects, SSR or SSG should be chosen directly instead of dynamic rendering.

Rendering Meta Tags and Open Graph Data on the Server

Social media crawlers (Facebook, Twitter, LinkedIn) do not execute JavaScript. So if Open Graph tags (og:title, og:description, og:image) and Twitter Card tags are injected with JavaScript, the title, description and image won't appear when the page is shared on social media. This directly affects the traffic potential from social media.

In SSR and SSG architectures, meta tags are rendered on the server in the <head> section of the HTML. In Next.js, the generateMetadata function or the <Head> component is used for this purpose; in Nuxt.js, the useHead composable. Giving every page unique meta tags, and making sure those tags can be verified with view-source:, is a basic requirement of SEO and social media optimization.

Edge Rendering and the TTFB Impact of Server Location

Edge rendering means performing SSR at the CDN edge location closest to the user rather than on a central server. Vercel Edge Functions, Cloudflare Workers and Deno Deploy are platforms that support this approach. With edge rendering, TTFB can be brought down to the 50–100 ms range regardless of geographic distance.

Edge environments, however, do not support the full feature set of the Node.js runtime. File system access, certain native modules and long-running processes don't work at the edge. So pages that require complex data fetching or heavy computation may not be suitable for edge rendering. In a hybrid approach, static and simple dynamic pages are rendered at the edge, while pages that need heavy backend processing are rendered with SSR on a central server.

How the Rendering Method Affects Core Web Vitals

The rendering method affects the three Core Web Vitals metrics in different ways. For LCP (Largest Contentful Paint), SSG has the edge; because static HTML is served directly from a CDN, it produces the fastest LCP values. SSR is slower than SSG, depending on server processing time. CSR produces the slowest LCP values because it waits for JavaScript to be downloaded and executed.

For CLS (Cumulative Layout Shift), SSR and SSG produce low values because the page structure is defined in the HTML. In CSR, elements added to the DOM after JavaScript runs can cause layout shifts. The INP (Interaction to Next Paint) metric depends on hydration time. Combining SSG with partial hydration delivers the best results on all three CWV metrics at once. As of 2026, this combination has become the standard architecture for performance-focused sites.

Structured Data and JSON-LD Compatibility With SSR/SSG

Structured data in JSON-LD format is served inside a <script type="application/ld+json"> tag in the <head> or <body> section of the page. In CSR architectures, when this script tag is injected into the DOM with JavaScript, there is a risk that the bot won't be able to read the structured data on its first crawl pass. In SSR and SSG, JSON-LD is rendered on the server together with the HTML and is available to the bot on the first pass.

To add JSON-LD in Next.js in an SSR/SSG-compatible way:

    
export default function ProductPage({ product }) {
  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'Product',
    name: product.name,
    description: product.description,
    offers: {
      '@type': 'Offer',
      price: product.price,
      priceCurrency: 'TRY'
    }
  };

  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
      />
      {/* Page content */}
    </>
  );
}
    

This structure guarantees that the structured data appears directly in the HTML source. When you check the URL with Google's Rich Results Test, you can confirm that the structured data is parsed correctly.

Critical Mistakes in SSR/SSG Configuration

In projects that move to an SSR or SSG architecture, recurring mistakes can cancel out the rendering advantage. Being aware of these mistakes determines whether the migration succeeds:

  • Calling browser APIs on the server: Objects such as window, document and localStorage do not exist in the server environment. These calls should be guarded with a typeof window !== 'undefined' check or placed inside a useEffect hook.
  • Hydration mismatch errors: Producing different HTML on the server and the client causes React to rebuild the DOM and increases CLS. Variables such as dates, random numbers or user-specific data are the usual source of this mismatch.
  • Leaving all data fetching on the client: Even after switching to an SSR/SSG framework, leaving data fetching inside useEffect causes the page to be rendered empty on the server.
  • Injecting meta tags on the client: Managing meta tags with document.title or document.querySelector('meta') wipes out the SEO advantage of SSR entirely.
  • Uncontrolled bundle growth: Bundling every component into a single JavaScript file lengthens hydration time and worsens the INP metric.

Choosing a Rendering Strategy by Content Type

No single rendering strategy is optimal for every page type. Modern web architectures support a hybrid rendering approach, and choosing the most suitable strategy for each content type maximizes both performance and SEO efficiency.

Blog posts and static pages are ideal for SSG; they rarely change and can be served from a CDN in a fraction of a second. Product pages need stock and price updates, so they should be managed with ISR. Search results and filter pages produce different content on every request depending on user input, so they require SSR. Dashboards and account pages don't need SEO and can be left as CSR. Building this decision matrix at the start of a project eliminates the cost of architectural revisions later on.

The rendering strategy is the cornerstone of technical SEO infrastructure. Whether the bot receives the full content on its first crawl pass is the first link in a chain that runs from indexing speed to ranking performance. Sites that configure SSR or SSG correctly keep control of that chain.

Was this article helpful?
Add Seobaz as a preferred source on Google to see us more often in your search results and AI answers.
Add as preferred source
Share this article
Turan Doğan
Founder · SEO & GEO Specialist
Publishing up-to-date guides on SEO, GEO and AEO since 2014, helping brands get seen on both Google and AI engines.
WhatsApp Online · Quick reply
Gift Wheel A discount on every spin
View Cart