Course contentsShow
← Web Development
Lesson 1753 of 2,98232. Server-Side Rendering ConceptsFree lesson

Resumability vs. Hydration

Comparing traditional hydration with frameworks that serialize event listeners and avoid re-execution.

Resumability vs. Hydration

You'll learn how resumability avoids re-executing JavaScript by serializing application state, unlike traditional hydration.

The Core Difference

Traditional hydration requires the client to re-execute all the JavaScript that ran on the server to "rehydrate" event listeners and restore interactivity. Even though the HTML is already painted, your framework must rebuild the component tree, attach event handlers, and essentially "rediscover" what the server already knew.

Resumability takes a fundamentally different approach: it serializes everything the server knows—including event listeners, component state, and framework context—directly into the HTML. When the page loads, the framework can "resume" exactly where the server left off without re-running application code.

The Analogy

Think of it like a video game save file:

  • Hydration is like watching a recording of someone playing a game, then replaying every action yourself to get to the same point.
  • Resumability is like loading a save file—you instantly start from where they left off.

What Gets Serialized

Frameworks with resumability serialize:

  • Event listener locations and types (which elements listen for what)
  • Component boundaries and relationships
  • Application state
  • Framework internal state

This serialized data lives in the HTML, so when JavaScript loads, it can "resume" interactivity instantly for just the parts the user interacts with—not everything upfront.

The Performance Win

Resumability eliminates the "execute all JavaScript to become interactive" problem. The initial page is interactive immediately for visible elements, and code loads on-demand as users interact with different features.

Key Takeaway: Resumability serializes state and event listeners into HTML to resume execution without replaying application logic, while hydration requires re-executing JavaScript to restore interactivity.