Answer first, build once and serve fast #
Prerendering generates static HTML at build time so visitors receive ready-to-display content immediately. Instead of rendering a page on every visit, the framework visits each marked route during the build, saves the HTML output, and deploys it to a CDN or edge network. The result loads quickly, ranks well for search, and needs almost no server compute per view.
This post is a learn/define explainer of prerendering as the default for stable pages. If you want the three-way decide/compare instead — prerender versus SSR versus CSR per route — see CSR vs SSR vs Prerendering.
Think of a bakery. Prerendering bakes the morning loaves before the doors open, so the first customer is served in seconds. Server rendering cooks each order from scratch after it arrives. Client-side rendering hands the customer a recipe and points at the kitchen. Every model feeds people. The question is which wait your visitors should stand in.
It is one of three rendering models. Prerendered static output suits stable content. Per-request server-side rendering suits personalized or frequently changing content. Client-side rendering suits app-like screens behind login. Most real sites mix all three page by page, and the mixing is the skill.
Try it: Sitemap Generator — so you can try this on your own site now.
How do the three rendering models compare side by side? #
With prerendering, HTML is produced once at build time and cached at the edge. Time to first content is fast because no database or render step runs on the request path. The tradeoff is freshness. Content updates require a rebuild or targeted revalidation. Google's rendering guide (https://web.dev/articles/rendering-on-the-web) places prerendering and static rendering at the fast end of this spectrum for exactly this reason: no request-time work means nothing to wait for.
With per-request SSR, the server renders fresh HTML for every visit. Personalized dashboards, auth-dependent pages, and rapidly changing listings stay correct by construction. The cost is latency and compute on every request, plus cache complexity when traffic spikes. You pay for freshness in milliseconds and in servers.
With CSR, the server sends a minimal shell and JavaScript builds the page in the browser. This keeps server work low and suits highly interactive private screens, but first paint waits on script download, execution, and API calls. Search indexing and slow devices suffer most, because both depend on work the server declined to do.
In SvelteKit terms, prerendering is a per-page choice, not an all-or-nothing site mode. Marketing pages, docs, and blog posts are natural static candidates, while account pages stay dynamic. The page options docs (https://svelte.dev/docs/kit/page-options) define the switch, and it is one export:
// +page.js for a marketing page: bake it at build time
export const prerender = true;// +page.server.js for a dashboard: render fresh per request
export const prerender = false;Two lines, two strategies, one codebase. That per-route granularity is the whole game.
| Model | When HTML builds | Fit | Tradeoff |
|---|---|---|---|
| Prerender | Build time once | Marketing and blog | Fast but static |
| Server render | Every request | Personal dashboards | Fresh but more compute |
| Client render | In browser | Private app shells | Interactive but delayed first paint |
| Hybrid | Page by page | Most BYOB sites | Needs per route choice |
Why does static HTML win for speed and SEO? #
Static pages skip the request-time render entirely. Edge caches serve nearby bytes, first paint arrives early, and layout shift drops because content is present in the initial response. These properties directly help conversion on landing and content pages, where every hundred milliseconds of delay trims revenue.
Search engines benefit for the same reason. Crawlable HTML with real content in the first response is easier to index than a shell that requires script execution. Google's JavaScript SEO docs (https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics) explain that rendering-dependent content costs crawl budget and risks being seen late or incompletely. Metadata, canonical links, and structured data travel with the prerendered output, so social previews and snippets stay correct without extra machinery.
The operational win is scale without servers to babysit. Static output absorbs traffic spikes through caching rather than compute autoscaling. A homepage that survives a front-page surge does so because no code runs when it is viewed. That simplicity is why one-click deployment platforms lean heavily on prerendered routes with dynamic islands where needed, a pattern the deployment explainer shows end to end (https://byob.studio/blog/byob-one-click-deployment-explained).
What is hydration cost and when should you not prerender? #
Prerendered HTML still needs JavaScript to become interactive, a step called hydration. The browser replays component logic, attaches event handlers, and reconciles state. Large bundles or heavy client effects can make a fast-painting page feel sluggish for a moment after load. The page looks ready and ignores clicks, which users experience as broken rather than slow.
Manage hydration cost by shipping less JavaScript to static pages, deferring non-critical widgets, and reserving rich interactivity for routes that need it. Measure interactive delay on real devices in addition to desktop, because mobile CPUs pay the highest hydration price. A page that hydrates instantly on a laptop can stutter for a second on a mid-range phone.
Do not prerender what must be fresh per user. Authenticated dashboards, carts, per-user settings, and rapidly changing inventory belong in SSR or CSR. Prerendering them risks leaking one user state into another view or serving stale decisions. A good rule is that public and stable means static, while private or live means dynamic. When in doubt, ask who the page is for: everyone and unchanging favors the bake, someone and shifting favors the kitchen.
How do adapters and deployment shape a page-by-page plan? #
In SvelteKit, an adapter translates the built app for a hosting target, including edge platforms through a Cloudflare-style adapter. Prerendered routes become static assets served from cache, while dynamic routes run as edge functions. One repository serves both strategies with no duplicated code. The adapter handles the mechanics while your team sets the policy per route, and the policy stays visible in the file tree. The same codebase therefore ships both models without separate projects. How BYOB wires SvelteKit to the edge is covered in the framework guide (https://byob.studio/blog/how-byob-uses-sveltekit).
Plan rendering per route. Prerender the homepage, pricing, docs, and blog. Server-render account pages, checkout state, and personalized feeds. Use CSR inside authenticated shells for filters, editors, and dashboards after the initial frame. Document the split in one place so future routes inherit a decision instead of a debate. A short table of route, model, and reason prevents the slow drift where every new page defaults to dynamic because nobody remembers why static was the default. Defaults decide architectures more than architects do. Revisit the split whenever content freshness requirements change, because today's marketing page is tomorrow's personalized landing experiment.
Prerendering is not nostalgia for static sites. It is a deliberate performance default with clear escape hatches. Audit the split twice a year. Traffic patterns shift, personalization creeps into static pages, and yesterday's dashboard becomes tomorrow's marketing asset. Each audit takes an hour and keeps the fast pages fast. The ovens stay hot, the kitchen stays ready, and every visitor waits exactly as long as their page deserves. No more, no less.
Who this is for (and who should skip it) #
Prerendering in SvelteKit fits stable marketing and content pages that should load fast and stay visible to crawlers without per-request work; keep dashboards, carts, and settings dynamic. Skip prerender for per-user or fast-changing data where static output would leak state or serve stale decisions. Limit: prerendered pages still pay hydration cost, so ship less JavaScript to static routes.
This fits if your pages are stable marketing or content that should load fast and be visible to crawlers without per request work. Prerender for speed and search, keep dynamic routes live.
Skip prerender for per user dashboards, carts, and settings where static HTML would share state or serve stale decisions.
- Best for developers serving stable marketing pages as static HTML for speed and SEO.
- Best for startups mixing prerendered pages with server rendering for fresh or personal content.
- Best for freelancers picking per-page rendering without paying server cost on every view.
What we learned building this #
This BYOB marketing site pre-renders blog, glossary, tool, and marketing pages to static HTML at build time, while dashboard and live-data routes stay dynamic. The server config keeps marketing pages static and app routes live, and the glossary entry documents the same opt-in, opt-out model. In practice we pre-render stable content for speed and search and leave per-user or live data to render on demand.