mediumFrontend

What is the difference between client-side and server-side rendering?

83 views
01

Understand the problem

Addresses architectural understanding in modern web development.

renderingssrcsrweb architecture
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Stuck? AI Nudge Available

Get a conceptual hint to guide your logic without spoiling the final implementation.

03

Study the solution

The solution is waiting

Give it an honest attempt first — then compare your thinking with the full walkthrough.

04

Read the code

The shapes of CSR vs SSR
// CSR: the server sends an almost-empty shell…
//   <body><div id="root"></div><script src="/app.js"></script></body>
// …and the browser builds the UI:
const root = document.getElementById("root");
root.innerHTML = renderApp(); // React/Vue mount here on the client

// SSR: the server returns FULL HTML for the request…
//   const html = renderToString(App);  // runs on the server
//   res.send("<div id=root>" + html + "</div><script src=/app.js>");
// …then the client HYDRATES the existing markup (attaches handlers):
//   hydrateRoot(document.getElementById("root"), App);

// SSG = the same server render, but done once at BUILD time.
05

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.