What is the difference between prerendering, SSR, and CSR in SvelteKit?

Answer

SvelteKit supports three rendering modes configurable per-page: SSR (Server-Side Rendering): default. The server renders HTML for each request using the current data. Good for dynamic content (user-specific pages, frequently changing data). Prerendering (SSG): pages are rendered to HTML files at build time. Deploy as static files. Good for content that changes rarely (blog posts, docs). Enable: export const prerender = true. SvelteKit discovers all pages at build time and generates HTML for each. Dynamic routes can be prerendered with entries. CSR (Client-Side Rendering): the server sends a shell HTML with JavaScript; the browser renders everything. No server needed after initial HTML. Enable: export const ssr = false. Good for auth-gated dashboards where SEO isn't needed. You can mix: most pages SSR, blog posts prerendered, user dashboard CSR. The default "SSR with client-side navigation" provides the best balance of SEO and UX.