Astro rendering modes

[check: …]
📖 Full guide → 📖 ASTRO_RENDERING_MODES.md — the complete narrative, code samples, and verified sources. This page is its interactive companion.

The output rule (Astro 5)

Astro 5 has TWO output modes: output: 'static' (the default — bake HTML at build time) and output: 'server' (render fresh per request). output: 'hybrid' was removed in Astro 5 — the old hybrid behavior is now just 'static' with a per-route export const prerender = false.

Either way, a route's prerender export wins over the mode default: true → built at build time, false → rendered on demand. Any on-demand route needs a server adapter and a host that runs JS.

'static' + prerender:false = on-demand (the modern hybrid) 'server' + prerender:true = back to build-time no adapter = pure static only

Request-flow explorer — pick an output mode + a route

Choose an output mode and what the route exports, then watch which lane actually produces the HTML. The lane that lights up is where your HTML is born — the other is skipped.

1. output mode (astro.config.mjs)

2. this route's prerender export

a user requests this route
LANE 1 · BUILD TIME astro build
LANE 2 · REQUEST TIME per visitor

Route frontmatter

--- (no prerender export) ---

Verdict

The 4 official server adapters

On-demand rendering needs a runtime that runs your code. Add one with npx astro add <name> — it installs the adapter and wires adapter: in astro.config.mjs. Pure-static sites need none.

Comparison — output mode × prerender → when rendered → adapter?

This bundle is HOW Astro decides build-time vs on-demand: two output modes + a per-route prerender override. Cross-refs: 🔗 astro_islands (what gets shipped to the browser) · 🔗 astro_content_collections (typed content for static routes) · 🔗 metaframework_landscape (where Astro sits vs Next/Remix).