Questions
20 of 33
1Explain server-side rendering (SSR) in Next.js.
2List the benefits of Server-Side Rendering in Next.js.
3What are server components?
4How to use server components in next js?
5What is the React Server Component Payload (RSC)?
6Describe how server components are rendered.
7Describe server rendering strategies
8How can you keep Server-only Code out of the Client Environment
9What are the issues of using context provider at the root of the application?
10List dynamic functions available to server components.
11List all Dynamic APIs.
12How do we opt for Static Rendering, Dynamic Rendering and Streaming?
13Explain the difference between SSR, SSG, ISR, and CSR in Next.js. When would you choose each?
14How does getServerSideProps work internally? What is its execution context?
15What are the performance trade-offs of SSR vs SSG in a high-traffic production app?
16How does Next.js handle hydration? What is a hydration mismatch, and how do you debug it?
17What happens when getServerSideProps throws an error? How do you handle it gracefully?
18How would you architect a Next.js app that needs both personalised (SSR) and cacheable (SSG) pages at scale?
19Explain the App Router vs Pages Router SSR model differences. How does React Server Components change the SSR paradigm?
20How do React Server Components (RSC) differ from traditional SSR? Can they be used together?
21How does streaming SSR work in Next.js 13+? What role does Suspense play?
22How would you implement partial hydration or Islands Architecture in Next.js?
23Explain how Next.js handles data fetching waterfall problems in SSR and how you'd mitigate them.
24How would you implement partial hydration or Islands Architecture in Next.js?
25How do you implement caching strategies for SSR responses in Next.js? (CDN, Cache-Control, stale-while-revalidate)
26How would you reduce TTFB (Time to First Byte) in an SSR-heavy Next.js app?
27What's the difference between fetch caching in the App Router vs traditional getServerSideProps?
28How do you avoid redundant database/API calls across multiple server components on the same page?
29How do you securely handle authentication in SSR? What are the risks of passing tokens via cookies vs headers?
30How do you prevent sensitive server-side data from leaking to the client bundle?
31How would you implement role-based rendering on the server without exposing protected routes to the client?
32How do you debug SSR-only issues that don't appear in local development?
33How can we control dynamic rendering behaviour in next js?
20 / 33

How do React Server Components (RSC) differ from traditional SSR? Can they be used together?

React Server Components (RSC) differ from traditional SSR by focusing on component-level rendering without client-side JavaScript, while traditional SSR hydrates entire pages; they work together seamlessly—RSC handles data fetching and rendering, while SSR provides the initial HTML shell

React Server Components (RSC) and traditional SSR operate at different layers and solve different problems, yet they complement each other perfectly. Traditional SSR generates HTML on the server and sends it to the client, where it's hydrated with JavaScript to become interactive. RSC, by contrast, is a data-fetching and rendering mechanism that produces a special serializable format (RSC Payload) that describes the component tree, but it doesn't generate HTML directly. In Next.js App Router, they work in concert: RSC runs on the server to fetch data and render components, producing both HTML (for initial page load) and the RSC Payload (for client navigation and hydration), giving you the best of both worlds—fast initial page loads with minimal JavaScript.

Core Differences at a Glance
  1. 1

    Output format: Traditional SSR produces HTML; RSC produces a special binary format (RSC Payload) that describes the component tree with client component references.

  2. 2

    JavaScript shipping: Traditional SSR ships component code to client for hydration; RSC ships zero JavaScript—only the rendered output reaches the client.

  3. 3

    Re-rendering: Traditional SSR requires full page reloads or client-side routing with data fetching; RSC Payload enables seamless navigation with server-side rendering preserved.

  4. 4

    Data fetching: Traditional SSR uses getServerSideProps or similar at page level; RSC allows data fetching inside any component with async/await.

  5. 5

    Execution environment: Both run on server, but RSC maintains a persistent component tree across requests through the RSC Payload.

Traditional SSR (Pages Router) - HTML Focused
React Server Components (App Router) - Component Focused

In Next.js App Router, RSC and traditional SSR aren't alternatives—they're integrated layers. When a request arrives, the server runs Server Components to generate the RSC Payload, then uses that payload to render the initial HTML (traditional SSR). This HTML is sent immediately, giving users a fast First Contentful Paint. Meanwhile, the RSC Payload is embedded in the HTML or streamed separately. On the client, React uses this payload to reconstruct the component tree without re-fetching data or re-running Server Components. When users navigate, the client fetches only the RSC Payload for the new route (not full HTML), enabling fast transitions while preserving the server-side data fetching model.

The RSC Payload Explained
  1. 1

    What it contains: The RSC Payload is a compact binary representation of the Server Component tree, including rendered output of Server Components and references to where Client Components should be mounted.

  2. 2

    How it's used: During initial load, it's used alongside HTML for hydration. During navigation, it's fetched directly to update the UI without full page reloads.

  3. 3

    Size advantage: Because it doesn't include component code, only rendered output, it's much smaller than sending JavaScript bundles.

  4. 4

    Streaming support: The payload can be streamed incrementally as Server Components resolve, enabling Suspense boundaries to populate progressively.

Traditional SSR sends JavaScript for the entire page, then hydrates everything—even static elements like headers and footers. RSC flips this model: only components explicitly marked with 'use client' ship JavaScript. A page with 90% static content and 10% interactive widgets might ship 90% less JavaScript than its Pages Router equivalent. This is possible because Server Components render on the server and their output becomes part of the RSC Payload, with no code ever reaching the client. The FollowButton example above: the button's JavaScript (useState, onClick) ships, but the user data and posts rendering logic never does.

JavaScript Bundle Comparison
When Traditional SSR Still Matters
  1. 1

    Initial page load: RSC alone doesn't produce HTML—it needs SSR to generate the initial HTML for fast First Contentful Paint and SEO.

  2. 2

    Search engine crawlers: While some crawlers execute JavaScript, HTML ensures reliable indexing across all search engines.

  3. 3

    JavaScript-disabled environments: Users with JavaScript disabled still see content because HTML is present.

  4. 4

    Performance budget: The initial HTML from SSR gives immediate content while RSC Payload loads in background.

  5. 5

    Progressively enhanced apps: RSC with SSR creates applications that work without JavaScript and enhance when it loads.

In Next.js App Router, the rendering pipeline integrates both technologies seamlessly: When a request arrives, the server executes all Server Components in the route, generating the RSC Payload. Simultaneously, it renders this payload to HTML (traditional SSR). The HTML streams to the client immediately, while the RSC Payload follows. On the client, React uses the HTML for initial paint, then hydrates using the RSC Payload—but only hydrates Client Components. For subsequent navigations, the client fetches fresh RSC Payload directly from the server, skipping HTML generation entirely. This gives you the best of both worlds: fast initial loads and efficient client-side transitions.

Navigation Flow with RSC + SSR

As React and Next.js evolve, the line between RSC and traditional SSR continues to blur. Partial Prerendering (PPR) extends the model by prerendering static shells at build time while keeping dynamic sections streaming. This combines SSG's performance with RSC's flexibility. In Next.js 16, concepts like 'Cache Components' are emerging to make caching declarative at the component level. The ultimate goal is a unified model where components declare their data and caching needs, and the framework automatically chooses the optimal rendering strategy—static, dynamic, or incremental—for each part of the page.