What is SSR and what are its advantages over a client-side SPA?
This tests server-client rendering trade-offs. A strong answer defines SSR as server HTML generation plus client hydration, citing faster time-to-content, better SEO for async data, and unified component logic.
WHAT THIS TESTS: This question probes whether you understand the request lifecycle and where rendering work happens. Interviewers want to see that you know SSR is not just a deployment mode but a shift in when and where HTML is produced, and that you can weigh its benefits against operational costs.
A GOOD ANSWER COVERS: First, define SSR clearly: Vue components are rendered to HTML strings on the server, those strings are sent to the browser, and the client hydrates the static markup into a fully interactive application. Second, explain faster time-to-content and improved Core Web Vitals: because the server sends rendered markup immediately, users on slow networks or devices see content before all JavaScript downloads and executes, and initial data fetching happens over a fast server-side database connection rather than the client network. Third, cover SEO: search crawlers receive fully rendered HTML without waiting for asynchronous Ajax calls, which is critical when content is fetched asynchronously. Fourth, mention the unified mental model: the same Vue components and declarative logic run on both server and client, avoiding context switching between backend templates and frontend frameworks. Fifth, acknowledge trade-offs: browser-specific code must be guarded behind lifecycle hooks, build and deployment require a Node.js environment rather than static file hosting, and rendering consumes more CPU per request so caching matters.
COMMON WRONG ANSWERS: A red flag is claiming SSR is only for SEO or that Google cannot index SPAs at all; the canonical docs note that Google and Bing handle synchronous JavaScript fine, so SSR is specifically necessary when content loads asynchronously. Another red flag is omitting hydration entirely and describing SSR as just static HTML with no client-side interactivity. A third is ignoring server load: candidates who present SSR as free performance without mentioning increased CPU usage or deployment complexity signal shallow experience.
LIKELY FOLLOW-UPS: An interviewer might ask how hydration mismatches occur and how to debug them, or when you would choose Static Site Generation over SSR. They may also ask how you prevent cross-request state pollution in a Vue SSR app, or what strategies you use to cache server-rendered pages and reduce Node.js CPU load.
ONE CONCRETE EXAMPLE: Imagine an e-commerce product page that fetches pricing and inventory from a database. In a pure SPA, the browser downloads a shell, executes Vue, then makes an Ajax request for product data, leaving the user staring at a spinner. With SSR, the Node.js server queries the database, renders the complete product card and buy button into HTML, and streams it to the browser. The user sees meaningful content in milliseconds, search engines index the price and description immediately, and Vue hydrates the add-to-cart button on the client so it becomes interactive without a full page reload.
Read the original → vuejs.org
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.