Skip to content

What is Prerendering (Static)?

Build-time HTML generation: pages render once during the build and ship as static files. This BYOB site defaults to prerendered routes with explicit opt-outs, so content loads fast and crawlers see complete markup.

Example

This site sets prerender to true in the root layout so marketing, blog, glossary, and tool pages build to static HTML, keeps the dashboard on automatic prerendering, and disables it for the fetch-page API endpoint.

What people get wrong

Teams often assume every route should prerender, then watch authenticated pages leak shared HTML or builds fail on dynamic params. Prerender stable content; leave sessions and live endpoints dynamic.

Frequently asked questions

When should a route opt out of prerendering?

Opt out when output depends on the request: logged-in dashboards, per-user data, or endpoints fetching live pages. This codebase marks the dashboard automatic and the fetch-page endpoint false for exactly that reason.

What is the difference between true and automatic?

True always emits static HTML at build time, while automatic lets SvelteKit decide per route. True suits stable content pages; automatic suits mixed sections like the dashboard shell.

Sources

Browse all Build & Render Performance terms →