tezvyn:

Compare SSR, SSG, and ISR trade-offs in meta-frameworks

AI-drafted, machine-checkedSource: svelte.devadvanced
Compare SSR, SSG, and ISR trade-offs in meta-frameworks

What it tests: matching rendering modes to build time, freshness, and scale. Outline: contrast SSR per-request cost with SSG fast CDN delivery but stale content and long builds, then show ISR as lazy regeneration post-deploy.

WHAT THIS TESTS: Whether the candidate understands that rendering is not one-size-fits-all and can map trade-offs between server effort, build time, cacheability, and freshness to product requirements. The interviewer wants to see nuanced decision-making about when to pay per request versus paying at build time versus deferring cost to post-deployment regeneration. They also want to know if you recognize that these modes can coexist within a single codebase rather than forcing an architectural split into separate services.

A GOOD ANSWER COVERS: First, SSR renders the initial page on each request which improves SEO and perceived performance but requires a running server and adds latency on every hit. Second, SSG prerenders pages at build time so they can be served from a CDN for maximum speed and scale, yet updates require a new build and very large sites face long build times. Third, ISR serves a static version immediately and regenerates the page in the background after deployment, which avoids the full build penalty for massive sites while keeping delivery fast. Fourth, SvelteKit specifically supports mixing these modes across pages and offers adapter-vercel for ISR, while adapter-static handles traditional SSG. The candidate should note that SvelteKit defaults to SSR for the first page and CSR for subsequent navigation, a hybrid called transitional apps, and that you can remove JavaScript entirely on specific pages with csr set to false or data-sveltekit-reload if needed.

COMMON WRONG ANSWERS: Claiming ISR is just a CDN cache header or that it works identically on every hosting platform. Saying SSG is always faster than SSR without acknowledging build time or update lag. Asserting that SvelteKit cannot mix rendering strategies when the docs explicitly allow prerendering some routes while dynamically server-rendering others. Recommending a full SPA for content that changes frequently and needs SEO. Another mistake is assuming static generation means zero server involvement; in SvelteKit you can still use server files alongside prerendered pages if you choose a hybrid adapter.

LIKELY FOLLOW-UPS: How would you handle authentication on an ISR page that shows personalized data? At what scale does SSG build time become prohibitive and how would you measure it? How do you invalidate ISR content before the automatic regeneration triggers? Can you combine SSR and SSG within the same SvelteKit project and how would you configure that? They might also ask how adapter-static differs from adapter-vercel in terms of routing and whether ISR can be used alongside edge functions.

ONE CONCRETE EXAMPLE: An e-commerce site with ten thousand product pages where prices and inventory change multiple times per day. Traditional SSG would require a rebuild on every price change, leading to hour-long builds and stale buy buttons. Pure SSR would mean every product view hits the server, increasing cost and response time under traffic spikes. ISR with adapter-vercel lets you prerender the catalog at build for instant loads, then regenerate individual product pages in the background after deployment as inventory updates, keeping content fresh without rebuilding the entire site. This approach scales because only the changed SKUs regenerate, not the whole catalog, and shoppers still receive sub-second page loads from the CDN edge.

Source: svelte.dev (SvelteKit Docs)

Read the original → svelte.dev

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.