SEO

Hydration

Also called Rehydration, client-side hydration

The step where JavaScript attaches event handlers and state to HTML the server already delivered, making it interactive.

Quick facts: Hydration

Category
SEO
Also called
Rehydration, client-side hydration
Level
Advanced
Affects
Interaction responsiveness, perceived speed, layout stability
Where to see it
PageSpeed Insights, Chrome DevTools performance panel, Search Console Core Web Vitals report
In this article4
  1. How hydration works
  2. Why hydration matters
  3. Where hydration goes wrong
  4. What to do about it

How hydration works

The page arrives as finished HTML, either from server-side rendering or from a pre-built file, and the browser paints it. That is the point where the visitor can read the page. Behind the scenes the JavaScript bundle is still downloading. Once it lands, the framework runs the same component tree again in the browser, walks the elements that are already on screen, and attaches event handlers and state to them.

From that moment the page is a working application: menus open, filters apply, forms validate, links are handled by the framework rather than the browser. Nothing visible changes when hydration finishes, which is precisely what makes it easy to overlook.

Why hydration matters

It creates a window where a page looks finished but does nothing. Someone taps the menu, gets no response, taps again, and by the time the handlers attach the page receives a burst of queued input it then has to process. That experience is measured — it is what Interaction to Next Paint is designed to capture — but the damage happens before any metric is read.

The cost falls almost entirely on the processor, so it scales with the device rather than the connection. A bundle that hydrates imperceptibly on a developer’s laptop can hold a budget Android phone for a stretch the owner notices. Since that phone is the typical device for most traffic in Nepal, testing only on desktop hides the whole problem.

Where hydration goes wrong

The classic failure is a mismatch. If the HTML the server produced differs from what the client’s first render produces — a date formatted in a different time zone, a randomly generated element id, a greeting that depends on the logged-in user, a check that only works in a browser — the framework cannot reconcile the two. Depending on the version it may warn, patch the difference, or throw the server markup away and rebuild the section, which shows up as a flicker or a jump in the layout.

The second problem is scope. Whole pages are routinely hydrated when a header, a form and a carousel are the only interactive parts, so the browser does a great deal of work to reactivate paragraphs that will never be clicked. The third is content that is injected during hydration rather than merely revealed by it. Text hidden inside a closed accordion in the server HTML is fine; text that does not exist until JavaScript builds it is not, and may never be indexed.

What to do about it

Hydrate less. Split the bundle by route so a page only loads its own code, defer components that sit below the fold until they are near the viewport, and treat interactive elements as islands in a mostly static page rather than making the whole document an application. This is the single change that moves the needle most.

Then remove the mismatches. Format dates and currencies on the server, or after the component has mounted; keep random values and browser-only checks out of the first render. Make sure everything you want indexed is present in the server HTML rather than added during hydration. Finally, measure on the hardware your visitors actually use: field data in Search Console and a throttled mobile profile in PageSpeed Insights will tell you what a real phone experiences, and a serious page speed effort starts there rather than with a desktop score.

Do and do not

Do

  • Hydrate only the components that need to be interactive
  • Test on a mid-range phone, not a laptop
  • Keep indexable content in the server HTML

Do not

  • Render dates or random ids differently on server and client
  • Ship one bundle covering every route
  • Judge interactivity by when the page first appears

Questions people ask about this

Does hydration affect SEO?

Indirectly. Crawlers read the server HTML, so anything already present is fine whether or not hydration completes. The risk is content that only exists once JavaScript has built it, which may be missed. Slow hydration also worsens interaction responsiveness for real visitors, and that is part of how page experience is assessed.

What is a hydration mismatch?

It happens when the markup the browser generates on its first render does not match the HTML the server sent. Common causes are dates rendered in a different time zone, random identifiers, personalised content and code that assumes a browser. The framework then patches or rebuilds that section, which visitors see as a flicker or a shift.

How do I know if hydration is slowing my site?

Look for a gap between the page appearing and the page responding. Load it on a mid-range phone, try to tap something as soon as text is visible, and note whether anything happens. In tooling, a long main-thread block after first paint and poor Interaction to Next Paint in field data both point the same way.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.