0
0
Vueframework~10 mins

SSR vs CSR mental model in Vue - Visual Side-by-Side Comparison

Choose your learning style9 modes available
Concept Flow - SSR vs CSR mental model
User requests page
Browser shows full page
User interacts
Server can send updates
This flow shows how Server-Side Rendering (SSR) sends a ready HTML page from the server, while Client-Side Rendering (CSR) sends JavaScript to the browser which builds the page there.
Execution Sample
Vue
/* SSR: Server sends HTML */
fetch('/page')
  .then(response => response.text())
  .then(html => display(html))

/* CSR: Browser loads JS, then renders */
loadScript('app.js')
  .then(() => renderPage())
This code shows SSR fetching HTML directly, while CSR loads JavaScript first and then renders the page.
Execution Table
StepActionEnvironmentResultUser Sees
1User requests pageBrowserRequest sent to serverBlank or loading screen
2Server renders HTMLServerFull HTML page generatedNot visible yet
3Server sends HTMLServer -> BrowserHTML arrives in browserPage content appears quickly
4Browser displays HTMLBrowserHTML parsed and shownFull page visible immediately
5Browser loads JS bundleBrowserJavaScript downloadedPage interactive after load
6User interactsBrowserEvents handled by JSPage responds instantly
7CSR alternative: Browser loads JS firstBrowserJavaScript downloadedLoading screen
8CSR renders pageBrowserDOM created dynamicallyPage visible after JS runs
9User interactsBrowserJS handles eventsPage responds
10End--Page fully interactive
💡 Execution ends when page is fully interactive and user can interact with content.
Variable Tracker
VariableStartAfter Step 3After Step 5After Step 8Final
HTML contentemptyfull HTML from serverfull HTML displayedempty (CSR)full HTML displayed (SSR)
JS bundlenot loadednot loadedloadedloadedloaded
Page visiblenoyes (SSR)yesyes (CSR)yes (CSR after render)
User interaction readynonoyesyesyes
Key Moments - 3 Insights
Why does SSR show the page content faster than CSR?
Because SSR sends a fully rendered HTML page from the server (see execution_table step 4), so the browser can display it immediately without waiting for JavaScript to load and run.
Why does CSR show a loading screen before the page appears?
CSR must first download and run JavaScript to build the page (execution_table steps 7 and 8), so the user sees a loading state until this process finishes.
Can the user interact with the page immediately after SSR HTML is displayed?
Not always; the page becomes interactive only after JavaScript loads and runs (execution_table step 5), so initial HTML display is fast but interactivity depends on JS.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does the browser first display the full page content in SSR?
AStep 4
BStep 3
CStep 7
DStep 8
💡 Hint
Check the 'User Sees' column for when the full page becomes visible in SSR.
According to the variable tracker, when does the JS bundle become loaded in SSR?
AAfter Step 3
BAfter Step 5
CAfter Step 8
DAt Start
💡 Hint
Look at the 'JS bundle' row and see when it changes from 'not loaded' to 'loaded'.
If the server delays sending HTML, which step in the execution table will be affected first?
AStep 2
BStep 5
CStep 3
DStep 7
💡 Hint
Consider when the HTML arrives in the browser in SSR.
Concept Snapshot
SSR (Server-Side Rendering): Server builds full HTML page and sends it to browser.
Page appears quickly but needs JS for interactivity.
CSR (Client-Side Rendering): Browser loads JS first, then builds page.
Page shows loading until JS runs.
SSR is faster for initial display; CSR offers dynamic client control.
Full Transcript
This visual execution compares Server-Side Rendering (SSR) and Client-Side Rendering (CSR) in Vue. SSR means the server creates the full HTML page and sends it to the browser, so the user sees the page content quickly. The browser then loads JavaScript to make the page interactive. CSR means the browser first downloads JavaScript, then runs it to build the page dynamically, so the user sees a loading screen before the page appears. The execution table shows each step from user request to page interactivity, tracking actions on server and browser. The variable tracker follows key states like HTML content, JS bundle loading, and page visibility. Key moments clarify why SSR shows content faster and why CSR needs loading time. The quiz tests understanding of when the page appears and when JS loads. This helps beginners visualize how SSR and CSR differ in timing and user experience.