Back to the wiki

Hydration

Hydration (also known as ‘hydration’ in German) refers to the process whereby an HTML page, initially delivered in a static form, is brought to life in the browser by JavaScript, thereby making it interactive. The server delivers ready-made HTML that is immediately visible; JavaScript in the browser then ‘attaches’ the event handlers and the application state to this existing markup, so that buttons, forms and dynamic areas work. Hydration is therefore the link between server-side rendering and an interactive application.

Why hydration is necessary at all

Modern web frameworks aim to achieve two things simultaneously: the fast, search-engine- and AI-friendly delivery of finished HTML pages from the server, and the fluid, app-like behaviour of a single-page application in the browser. Server-side rendering solves the first part: the user and the crawler see the complete content immediately. However, to turn this static HTML into a usable application, the browser must rebuild the same component structure and add interactivity. This is precisely what hydration is.

The process step by step

  1. The server renders the components into finished HTML and sends it to the browser.
  2. The browser displays the HTML immediately; the page is visible but not yet fully interactive.
  3. The JavaScript bundle is loaded and executed.
  4. The framework synchronises its components with the existing HTML and attaches event handlers and state, rather than regenerating the markup.
  5. From this point onwards, the page is fully interactive.

Hydration compared to other rendering strategies

StrategyFirst visible contentInteractive fromHydration required?
Client-side renderinglate (after JS)after JSno
Server-side rendering + hydrationimmediatelyafter hydrationyes
Static Generation + Hydrationimmediatelyafter hydrationyes

The problem with costly hydration

Hydration has a catch: there can be a noticeable delay between the moment the user sees the content and the moment the page actually responds to clicks. This time span is known as ‘Time to Interactive’. On large pages with a lot of JavaScript, hydration can block the browser’s main thread, meaning that a page is visible but temporarily unresponsive – a confusing experience. For this reason, modern frameworks have developed techniques to reduce this overhead.

Partial and selective hydration

Instead of hydrating the entire page at once, newer approaches make only those parts interactive that actually need it. Purely static areas, such as blocks of text, remain untouched, whilst interactive sections, such as a shopping basket or a search box, are hydrated selectively. Other approaches defer the hydration of individual components until the user actually needs them. This reduces the amount of JavaScript that needs to be executed immediately and improves perceived speed.

Why hydration matters for SEO and AI visibility

It is not hydration itself that is crucial for discoverability, but rather that the server delivers complete HTML beforehand. Precisely because hydration allows server-side rendered HTML to be combined with interactivity, teams can harness the SEO and citation benefits of SSR without sacrificing a modern, app-like front end. Search engines and AI crawlers receive the finalised content, whilst users gain full interactivity after hydration. An AI visibility check can be used to verify whether a website presents its content clearly to AI systems.

Real-world example

A product detail page in an online shop is server-side rendered: the title, description, price and reviews are immediately present in the HTML, which benefits both loading time and visibility in search results and AI responses. However, the variant configurator, the ‘Add to basket’ button and the image gallery require JavaScript. Through hydration, it is precisely these elements that become interactive after the page has loaded, whilst the static product text remains unchanged. If the shop uses partial hydration, only the configurator section is hydrated immediately; the rest follows with a delay, which makes the page more responsive.

Using hydration correctly

Anyone building an SEO-friendly yet interactive front end will find it hard to do without hydration. It is important to keep the amount of JavaScript executed immediately to a minimum and to deliberately separate interactive areas. The official React documentation describes the process in technical detail. When implemented correctly, hydration is invisible: the user simply notices that the page loads instantly and can be used straight away.

Hydration mismatch and how to avoid it

A typical problem with hydration is what is known as a mismatch. This occurs when the HTML delivered by the server does not exactly match what the JavaScript in the browser expects. Causes include content that depends on the current time, random values or data that differs between the server and the browser. The framework then reports a discrepancy and, in the worst case, must discard the affected section and rebuild it, which impacts performance and can briefly lead to visible jumps.

This can be avoided by using the same data source on both the server and client sides, and by ensuring that time- or random-dependent content is only generated in the browser after hydration has taken place. Clean data flows are more important here than any performance trick.

Hydration and Core Web Vitals

Hydration has a direct impact on measurable quality metrics, particularly the Core Web Vitals. Of particular relevance is the responsiveness to initial user interactions: if a user clicks before hydration is complete, the page responds with a delay. A lean, well-structured hydration process therefore not only improves perceived speed but also search engine rankings, as these metrics are factored into the ranking algorithm.

Strategies for fast interactivity

  • Serve less JavaScript: The smaller the bundle, the faster the hydration.
  • Interactive islands: Only hydrate the areas that are genuinely interactive; leave static content untouched.
  • Deferred hydration: Only make components interactive when the user needs them or when they enter the visible area.
  • Streaming: Deliver HTML in chunks so that important areas become interactive sooner.

Frequently asked questions about hydration

Is hydration the same as server-side rendering?

No, the two go hand in hand, but they are not identical. SSR generates the HTML on the server; hydration then makes this HTML interactive in the browser. SSR without hydration would result in a page that is visible but not interactive.

Do I always need hydration?

Only if you’re combining server-side rendered HTML with client-side interactivity. A purely static page with no interaction doesn’t need hydration, nor does a purely client-side rendered frontend.

Why does a page sometimes feel briefly “frozen”?

This is often due to hydration: the page is visible, but the JavaScript is still processing the interactivity. This effect can be significantly reduced with partial or delayed hydration.

Hydration in modern meta-frameworks

In practice, most teams do not encounter hydration as an isolated concept, but rather as part of a meta-framework. These frameworks automatically orchestrate server-side rendering, delivery and hydration, allowing developers to focus on the application rather than the mechanics. They decide, on a per-page or even per-component basis, what is rendered on the server and what is hydrated in the browser.

The trend in recent years has clearly been towards minimising the amount of hydration required. Approaches such as interactive islands, where only individual components are hydrated, or streaming HTML in chunks, ensure that pages become usable sooner. Some frameworks even aim to avoid hydration as far as possible by only reloading interactivity when needed. For decision-makers, the message is simple: the rendering strategy is not a minor issue, but directly influences load time, visibility and user experience.

What this means for a project

  • Decide early on: Which areas require interactivity, and which are purely static?
  • Use JavaScript sparingly: Less code executed immediately means faster usability.
  • Choose the right framework: The choice of meta-framework determines how elegantly hydration can be controlled.

When well planned, hydration remains invisible to the user and delivers exactly what defines modern web applications: content that is available immediately and an interface that can be used straight away.

Further reading