PerformanceArchitecture
RSCFeb 23, 2026, 05:43:40 PM

Browser Rendering Pipeline

Understanding how a request transforms from a string of bytes into a fully interactive user interface. This is the 'Secret Sauce' of high-performance web engineering.

Rendering EnvServer Runtime

Strategy Details

The Critical Rendering Path (CRP) is the sequence of steps the browser goes through to convert HTML, CSS, and JS into pixels on the screen.

Hydration Logic

Pre-rendered HTML is sent to the client, then React 'hydrates' it to enable full interactivity.

1,200+
DOM Nodes
~14ms
Layout Time
Instant
Hydration
HTTP/3
Network

The Visual Journey

Click through the stages of the Critical Rendering Path to see how the browser builds this very page.

Critical Rendering Path

How the browser turns pixels into code.

Step 1

DOM Creation

Step 2

CSSOM

Step 3

Render Tree

Step 4

Layout (Reflow)

Step 5

Paint

Step 6

Composite

Deep Dive: DOM Creation

Browser parses HTML tokens into a tree of objects.

The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content.

<html>
  <body>
    <h1>Hello World</h1>
    <p>Parsing HTML...</p>
  </body>
</html>

The Ownership Matrix

Modern web apps are a symphony between the Browser Engine (Native C++) and the Frontend Framework (JavaScript/React).

Browser Engine

Blink (Chrome/Edge)WebKit (Safari)Gecko (Firefox)

Native code (C++) optimized for hardware performance.

Network Fetching

Fetching HTML/CSS/JS over HTTP/2 or 3.

HTML Parsing

Native DOM tree construction (C++ level).

CSSOM & Styling

Calculating CSS inheritance and specificity.

Layout Engine

Blink/WebKit calculating geometry.

Painting & GPU

Rasterizing pixels and GPU compositing.

Framework Layer

React (Next.js)Vue (Nuxt)Svelte (SvelteKit)

High-level JavaScript abstraction for Developer Experience.

Virtual DOM

In-memory representation of UI for diffing.

Reconciliation

Deciding exactly what changed in the state.

Hydration

Attaching JS event listeners to static HTML.

State Logic

Managing app data and side effects (Hooks).

Client Routing

Intercepting links to prevent full reloads.

The Bridge: Hydration

Hydration is the critical moment where the Framework takes over the Browser's static DOM. It doesn't recreate the DOM from scratch—it walks the existing DOM and "attaches" event listeners, making the page interactive without a re-paint.

Static Native DOM
Hydrated Interactive UI

SPA vs MPA: The Lifecycle

Understanding what happens to your Navbar and CSS when you click a link.

Classic

Multi-Page App (MPA)

Browser requests a new page, server sends full HTML. Browser trashes everything and starts the pipeline from scratch.

Nav Lifecycle
REQ
HTML
DOM
CSSOM
PAINT
Pros: Zero JS required
Cons: White screen flash
Client-Rich

Single-Page App (SPA)

Initial load is slow, but navigations are instant. Browser handles everything via JavaScript without full reload.

Nav Lifecycle
REQ
JS
JSON
DOM
PAINT
Pros: No fresh reload
Cons: Slow initial paint
Modern

Next.js Hybrid (RSC)

Initial load is SSR (fast). Navigations are client-side updates that preserve Layout/Navbar state.

Nav Lifecycle
REQ
SSR
HYDRATE
RSC-UP
Pros: Fastest TTFB
Cons: Complex logic
Navbar Persists!

Deep Technical Details

Parsing strategies and memory management for modern applications.

CSS Pipeline Impact

How the browser handles styles during the critical path.

Inline Styles

Blocking

Increases HTML size, no reusability, but zero network fetch.

Internal (Style Tag)

Blocking

Browser must parse full block before painting.

External (Link Tag)

Render Blocking

Standard fetch behavior. The browser halts painting until the file is fully downloaded.

The Caching Hierarchy

Who remembers your code? Server, CDN, or Browser?

HTTP Cache
Browser Memory

Browsers store External CSS and JS bundles locally. Next.js uses hashes (e.g. main-x123.css) to ensure users always have the latest code while maximizing cache hits.

Hydration Cache
React State

React keeps the DOM structure in memory. When navigating between pages in Next.js, the Navbar is never unmounted, so it doesn't re-calculate layout.

BFCache
Back/Forward

The Back/Forward Cache saves a snapshot of the entire page (including JS state) for instant navigation.

Does the Navbar recalculate?

In Next.js, the layout.tsx wrap ensures that the Navbar and Footer are hoisted above the page content. When you navigate, only the children slot updates. The browser does not re-parse the CSSOM or re-calculate the Layout for the navbar, providing that "App-like" feel.