What are Astro's rendering modes?

Answer

Astro supports three rendering modes configurable per-page. Static (SSG, default): pages are rendered to HTML files at build time. No server required after build. Deploy to CDN. Server (SSR): pages are rendered on the server for each request. Enable with output: "server" in astro.config. Access request context: const user = Astro.cookies.get("user"). Hybrid (SSG + SSR): default is static, opt-in to SSR per page with export const prerender = false. Or: default is server, opt-in to static with export const prerender = true. Enable with output: "hybrid". SSR requires an adapter: @astrojs/node, @astrojs/vercel, @astrojs/cloudflare, etc. Use SSR for: auth-protected pages, personalized content, form handling, and dynamic data. Use static for: blogs, docs, marketing pages. The hybrid mode is the most flexible — static by default for performance, SSR where dynamic content is needed.