Astro glossaryOn-demand rendering, or server-side rendering, builds an Astro page when someone requests it instead of once at build time.
Astro prerenders every page to static HTML when the site is built. On-demand rendering, also called server-side rendering (SSR), builds a page on the server each time someone requests it instead, so it can show fresh or personal content.
Switching it on
- Add an adapter for your host.
- Opt a single page in with
export const prerender = false; the rest of the site stays static. - Or set
output: 'server'to render every page on demand, and opt individual pages back into prerendering withexport const prerender = true.
Most sites mix both: static pages for content that rarely changes, on-demand pages for search, accounts, and checkouts, and server islands for the dynamic parts of static pages.
Source: Astro docs: On-demand rendering.