Client-side vs. server-side rendering (concept)
Computer Science · Web development
Question 1 of 10
0The defer attribute on a script tag tells the browser to:
Stuck? Read the explanation
Unlocks at a streak of 5 correct answers in a row.
Embed this practice on your site or class page
Paste this HTML into your page. Students practise right there; it is free and needs no account.
Client-side vs. server-side rendering (concept) explained
Rendering is the step that turns data into the HTML a browser displays. Server-side rendering builds that HTML on the server before sending it, while client-side rendering sends a mostly empty page and lets the browser's JavaScript build the content.
With server-side rendering, the server fills the page with data and sends complete HTML. The browser can show the content as soon as it arrives, and search engines and link previews can read the text directly. The cost is that the server does more work for each request.
With client-side rendering, the server usually sends a small HTML shell and a JavaScript bundle. The browser downloads the script, runs it, fetches data and then draws the page. This suits highly interactive applications, because later updates need no page reload. The cost is a slower first view on slow connections or weak devices, and search engines may need extra work to read the content.
Worked example
A hypothetical page needs a 300 KB JavaScript bundle before it shows content, and the connection delivers 150 KB per second.
- Download time for the bundle: seconds.
- Adding 0.4 seconds for the browser to run the script and fetch data, content appears after about seconds.
- A server-rendered page whose complete HTML arrives in 0.5 seconds shows content sooner in this example.
The numbers are illustrative. Real timings depend on the device, the network and the code.
What you will practise
105 multiple-choice questions (Easy, Medium, Hard). Each answer is followed by an explanation.
Example questions
- Client-side rendering runs:
- Server-side rendering builds pages:
- SSR improves:
- CSR enables:
- Hydration:
- Static site generation builds pages:
- In client-side rendering, the initial HTML is often:
- A browser's JavaScript engine is responsible for:
…and 97 more.