Sign inTry it

Server-side rendering (SSR)

Server-side rendering (SSR) means generating a page's HTML on the server for each request, instead of building it in the browser. The browser receives a complete page. Client-side rendering, by contrast, sends a bare page and builds the content with JavaScript in the browser.

Updated

How it differs from client-side rendering

Server-side renderingClient-side rendering
Where the HTML is builtOn the server, per requestIn the browser, with JavaScript
What the first response holdsThe page contentMostly an empty container
Needs JavaScript to show contentNoYes

Both approaches can show the same page. The difference shows up in what a tool gets without running JavaScript.

Why it matters for AI agents

SSR content is in the HTML response, so a plain HTTP request can read it. A client-rendered page may need a browser that runs its scripts. Many sites mix the two. SSR pages often also embed their data as JSON in a script tag, which is easier to read than the layout. See __NEXT_DATA__ for one example.

Wield and server-side rendering

Wield recipes can extract data from HTML with CSS selectors, so an SSR page can be read by a recipe that runs in your browser. For a client-rendered page, a recipe can call the JSON endpoint the page itself uses. See internal API.

FAQ

What is the difference between SSR and client-side rendering?

The place where the HTML is made. SSR makes it on the server before the response is sent, so the content is in the first response. Client-side rendering makes it in the browser after JavaScript runs.

Does SSR help AI agents?

It can. An agent or a plain HTTP client can read the content from the first response. SSR does not guarantee useful data, because the HTML may still bury the data in layout. Embedded JSON is often easier to read than the markup around it.

Sources

  1. Server-side rendering (MDN)developer.mozilla.org