Prerendering for AI crawlers: SSR, static and dynamic rendering

Most AI crawlers read only the HTML your server sends. Render pages on the server or at build time so the content is in that HTML for everyone; keep dynamic rendering for when nothing else is possible, and serve bots the same content people see.

Why do AI crawlers need prerendered pages?

Because most of them don't run JavaScript. Vercel found that among the major AI crawlers only Googlebot and Applebot rendered pages; OAI-SearchBot, ClaudeBot, PerplexityBot and the rest read the HTML the server sends. If a page's text is built in the browser, those crawlers get an empty app shell and have nothing to quote.

From Vercel's analysis of AI crawlers (opens in a new tab). How to spot the problem: our guide Can AI crawlers see JavaScript content?

What are the ways to send HTML instead of JavaScript?

Four, from web.dev's definitions. Server-side rendering (SSR) builds the HTML on the server for each request. Static rendering (SSG) builds an HTML file for every URL at build time. Prerendering runs a client-side app at build time and saves its first state as HTML. Dynamic rendering detects crawlers by user agent and serves them a rendered copy, while people get the JavaScript app.

Definitions from web.dev's Rendering on the Web (opens in a new tab) and Google's dynamic rendering page (opens in a new tab).

ApproachHTML builtEvery crawler sees contentTrade-off
Static rendering (SSG)At build timeYesOne file per URL; rebuild to update
Server-side rendering (SSR)Per requestYesServer work can slow the first byte
PrerenderingAt build time, from the client appYesNeeds more JavaScript to become interactive
Dynamic renderingFor detected bots onlyOnly bots it recognizesA workaround; extra cost and upkeep

Which one should I choose?

Static rendering where the content is the same for everyone and changes at build time, such as docs, blogs and marketing pages: it is fast because nothing is generated per request. Server-side rendering where content changes often or per request, at the cost of a slower first byte. Google and web.dev both recommend server-side or static rendering over the alternatives.

From web.dev's Rendering on the Web (opens in a new tab) and Google's dynamic rendering page (opens in a new tab).

Is dynamic rendering a good option for AI crawlers?

Only as a stopgap. Google calls dynamic rendering a workaround and not a recommended solution, because of its extra complexity and cost. It also depends on recognizing each crawler by its user agent: a new AI crawler, or one the rule list misses, gets the empty shell. Server-side or static rendering works for every crawler, including the ones you don't know about.

From Google's dynamic rendering page (opens in a new tab).

Is serving different HTML to bots cloaking?

Not if the content is the same. Google says dynamic rendering is generally not cloaking as long as it produces similar content, and that serving completely different content to crawlers and users can be. Its spam policy defines cloaking as showing different content to users and search engines to manipulate rankings and mislead users, such as text inserted only when a search engine asks for the page.

From Google's dynamic rendering page (opens in a new tab) and spam policies (opens in a new tab).

How do I check that the fix worked?

Fetch the page without JavaScript and look for your content: View page source in a browser, or curl the URL and search for a sentence from the middle of the page. Do it with an AI crawler user agent too, because dynamic rendering and CDN rules can treat bots differently. Our checker does both: it checks whether the main content is in the raw HTML, and fetches the page with an AI crawler user agent to see how it is answered.

Check your page without JavaScript

Scan a page: the report shows whether the main content is in the raw HTML and how a request as an AI crawler is answered.