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.
Related terms
SSR Per Request
Fresh HTML rendered on the server for every request, used for personalized or frequently changing pages. Server rendering guarantees complete markup on first paint but costs compute per visit, so reserve it for dynamic routes.
adapter-cloudflare
The SvelteKit build target that deploys this site to Cloudflare Workers. The adapter maps dynamic routes to workers and static files to assets, with route include and exclude rules controlling what runs at the edge.
Server-Side Rendering
Rendering full HTML on the server per request so crawlers and users receive complete content immediately. The SEO-safe default for content pages in frameworks like SvelteKit and Next.js.
CSR Shell
A minimal HTML shell that renders content in the browser after JavaScript loads. Client rendering suits authenticated dashboards behind login, where SEO matters less and interactivity starts only after scripts execute.
Hydration Cost
The JavaScript work that turns server-rendered HTML into an interactive app. Hydration replays component logic in the browser, so oversized bundles delay input readiness even when paint looks instant.
SvelteKit adapter-static
A SvelteKit build target that emits a fully static site with no server runtime. Fully static output fits documentation and marketing pages, but any route needing server logic must switch back to a server adapter.
Sources
Further reading
How BYOB Uses SvelteKit: Why We Chose Svelte for AI Website Building
BYOB generates SvelteKit applications because of smaller bundle sizes, simpler syntax, and built-in routing. Learn why we picked SvelteKit over React, Vue, and Next.js for AI-powered development.
SvelteKit Best Practices for 2024
Master the latest SvelteKit patterns and techniques to build faster, more maintainable web applications.