Skip to main content

JavaScript SEO And Prerendering: What Crawlers Actually See

· 8 min read
Indexation audit for large websites

A page can pass every manual check in a browser and still be invisible to a crawler, because the browser and the crawler receive different HTML. This post explains where in the rendering pipeline that divergence happens, which of the six real-world rendering setups you actually have, and what changes to your architecture or your templates will move the needle without a full replatform. The short answer is that rendering strategy is rarely the root cause on its own; it is more often the reason a genuine indexation problem stays hidden until you go looking for it.

The pipeline, in four stages​

Any URL you serve goes through the same four stages. The stage that matters is the one where HTML is produced.

StageWhat is producedWho sees it
DiscoveryA link, a sitemap entry, a redirectCrawler
FetchStatus code, headers, robots directivesCrawler
RenderExecuted DOM after JavaScript runsCrawler, optionally in two waves
IndexGoogle's judgement of the rendered resultSearcher

The third stage is where the trouble starts. Google's crawler will render JavaScript, and has done so at scale for years, but it does so under conditions that differ from a user's browser in ways that matter commercially:

  • Rendering is deferred. There is no guarantee that the deferred rendering happens at all, on any given day, for any given URL set.
  • Rendering is resource-capped. Google's renderer prioritises. A site that produces tens of thousands of pages a second will have a far lower proportion rendered quickly than a site that produces twenty.
  • Deferred rendering is separate from the initial fetch. A page can be indexed at stage three without ever appearing in your server logs, which makes log analysis a poor tool for this.
  • The bot that renders is not the bot that fetches. Googlebot renders; Googlebot Smartphone renders on a mobile viewport with a slower CPU budget and a memory ceiling. A page that renders on desktop and times out on mobile is not indexed.

A crawler rendering your page is a courtesy, not a contract. Build the page so that the first response is already correct and the second wave is a refinement.

The two populations​

The single most useful diagnostic question is whether your users and your crawler are receiving the same document. If the answer is no, everything downstream is guesswork.

SymptomUser seesCrawler sees
CSR without fallbackFull pageEmpty shell, script tags
CSR with skeletonFull page after 800 msSkeleton copy
SSRFull pageFull page
SSGFull pageFull page
Streaming SSRFull page, progressivePartial HTML, then chunks

The row that generates most support tickets is the first. A React or Angular single-page app with no server rendering sends a document that is, structurally, an empty container. Everything Google eventually indexes, it indexes because it decided to spend a render on it, not because your server gave it anything.

Why view-source is not a test​

The most common failing test in this area is opening view-source in a browser and concluding the page is fine, because the browser has helpfully re-fetched and executed the scripts before rendering the view. That proves your JavaScript works. It proves nothing about what was on the wire.

The tests that do carry information:

TestWhat it tells youWhat it does not tell you
curl the URL, read the bodyWhat the server actually sentWhether the render was deferred
URL Inspection, live testWhether Google rendered it on demandWhether it will render for 400,000 URLs
Rendered HTML versus raw HTML byte countHow much content is script-onlyWhich is more relevant
Render a sample from each URL patternPattern-level behaviourPer-URL behaviour

The row that catches most cases is the last one. A site can have a home page that prerenders perfectly and a product template that does not, and the difference is invisible until you sample by template rather than by site.

What prerendering actually means​

Prerendering means the HTML for a specific URL is generated at build time or on a cache fill, and served as the document. It is not a separate system; it is a change to when the same rendering work happens.

The difference between prerendering and server-side rendering in practice is where the cache sits, and that decides almost everything about cost and correctness:

// Client-side render: the document arrives empty, work happens in the browser
fetch('/product/12345')
.then((r) => r.json())
.then((data) => renderProduct(data));
// Prerender on demand: first request renders, second is served from cache
app.get('/product/:id', async (req, res) => {
const cacheKey = `product:${req.params.id}`;
const cached = await cache.get(cacheKey);

if (cached) {
res.type('html').send(cached);
return;
}

const html = await renderTemplate({ id: req.params.id });
await cache.set(cacheKey, html, { ttl: 3600 });
res.type('html').send(html);
});

The trade-off is freshness. Cached HTML goes stale, and stale HTML on a product page is a commercial problem, not merely a ranking one. Cache TTLs should be driven by how fast the underlying data changes, not by a global default.

The options, honestly ranked​

ApproachCrawler costFreshnessInfrastructure costFit
Static generationLowestBuild-time onlyLowestContent, docs, marketing
Prerender with cacheLowTTL-boundMediumLarge catalogues, product pages
Server-side renderMediumRequest-timeHighestPersonalised, frequently changing
Streaming SSRMediumRequest-timeHighSub-second TTFB matters
Dynamic renderingMediumRequest-timeMediumLegacy escape hatch
Client-side renderHighest for the crawlerPerfectLowestAlmost never correct for indexable pages

Dynamic rendering deserves a specific warning. Serving a pre-rendered snapshot to bots and the real app to users is explicitly something Google has said it will not indefinitely support, because it presents a different page to the crawler than to the user. It still works in the wild because enforcement is uneven, but building a plan on it is building on a borrowed timeline.

The indexation trap nobody plans for​

Rendering is rarely the indexation problem. It is more often the thing that makes one invisible, and there is a specific failure pattern worth naming.

A JavaScript-driven site with a filter system produces one URL pattern that renders, and four more that do not. The four unrendered patterns still return HTTP 200, still return valid HTML, and still appear in the sitemap. From the outside they look healthy. Google fetches them, spends nothing on rendering because the heuristics say they are low-value, and files them under "crawled, currently not indexed" — a verdict that gets misdiagnosed as a content quality problem for months.

The fix is architectural rather than editorial. If a URL pattern is not meant to be indexed, say so in the first response:

HTTP/2 200
X-Robots-Tag: noindex, follow
Cache-Control: public, max-age=600

If it is meant to be indexed, the HTML that arrives must contain the title, the canonical and the body copy. Both of those are decisions about templates, and neither of them requires anyone to run a render.

What does not work​

Adding a prerender library and leaving the template alone. Most prerendering libraries inject content into a container element and leave the document's head generated by the framework's client runtime. You get a body and no head, which is half a solution.

Blocking on render before responding. A server that waits for the client bundle to render before it returns anything trades one SEO problem for a performance problem. Crawlers get the content, and users get a slow first byte. Streaming SSR exists because this trade is avoidable.

Treating a render check as a template check. Passing a rendering test on one URL tells you about one URL. Templates drift, and the facet you never tested is the one generating forty thousand URLs.

Assuming Googlebot will keep rendering. It renders now. The business case for a prerendered first response is that it is correct regardless of whether any crawler ever executes a line of JavaScript again, which is a much more comfortable place to stand.

Where to start​

Fetch ten URLs per template with curl and read the bodies. If the body does not contain the product name, the price, or the main copy, you have your answer, and you have it in about four minutes without a single tool subscription.

Then decide per template whether the content is indexable at all, and answer that in the first response rather than in the second. Where it is indexable, move the HTML generation to build time or to a cache fill. Where it is not, an X-Robots-Tag header is cheaper and more reliable than a meta robots tag, because it does not depend on the parser reaching the right element.

When the templates are fixed, measure what the change actually moved. The site configuration guide covers crawl scope and rendering-sensitive settings, and running and monitoring crawls is where you set up the repeated sampling that stops this regressing quietly. For the pattern-level view of which templates produce which verdicts, triage and pattern analysis is the section to read next.