<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 "> Rendering Architectures: How a Page Reaches the User

Rendering Architectures: How a Page Reaches the User

This section covers where and when a page's initial HTML gets generated: in the user's browser, on the server for a request, or ahead of time. The choice affects when users see content, when controls respond, how search engines access content and where computation costs fall. All of these approaches still need the browser to display the page. Each approach below opens with a restaurant analogy: the page is a meal, the kitchen is the server, and the meal is served at your table, the browser.

CSR / SPA (Client-Side Rendering)

The ingredients come out of the kitchen and you cook at the table. With client-side rendering (CSR), JavaScript builds the UI in the browser; downloading and running that code and fetching data can delay the first view. Later updates can feel snappy without reloading the whole page, which is useful in applications behind a login, like dashboards, where search engines don't need to see the content and people stay long enough for a slower first load to pay off.

A single-page application (SPA) commonly handles navigation without loading a new document. That describes navigation, not just rendering: a SPA can start with server-generated HTML and then update in the browser.

SSR (Server-Side Rendering)

Each dish is cooked fresh to order in the kitchen, then served to your table. Server-side rendering (SSR) generates HTML on the server in response to a request, so content can appear before browser JavaScript runs. Generating it takes server work and can delay the response; cached responses reduce that work but may contain older data.

SSG (Static Site Generation)

Meals are pre-made and ready on the shelf, served to your table as soon as you order. Static site generation (SSG) prepares HTML ahead of requests, so there's nothing to build when a request arrives. That usually makes it the fastest and cheapest option to serve, since the files can be cached close to users. That HTML is shared rather than personalized per request, but browser code can fetch current or user-specific data afterwards; those parts still need loading and error states.

Hybrid and islands

A mostly pre-made plate with a few items cooked to order. Modern frameworks let teams choose the approach page by page, or even for parts of a page. Islands keep those interactive parts separate from the surrounding HTML. Hydration connects JavaScript behavior to existing HTML, so visible content and usable JavaScript-dependent controls may arrive at different times.

Rendering on the server

SSR is a return to how the web originally worked: the server builds the page from templates and sends finished HTML. Caching (keeping a ready-made copy), CDNs (copies stored on servers close to users) and edge computing (running code on those nearby servers) all help server-rendered pages load faster.

Trade-offs

ArchitectureWhat you gainWhat it costsBest fit
CSR / SPASnappy, app-like feel after the first load; cheap to hostSlower first load; weaker SEO; depends on the user's device and networkApplications behind a login, such as dashboards and internal tools
SSRFast first view; strong SEO; content built per request, so it can be fresh and personalizedHigher server cost; more infrastructure to run; caching helps under heavy traffic but can serve stale content; hydration may delay controlsPersonalized or frequently changing public pages
SSGFastest to serve and cheapest to host; few moving parts at request timeContent goes stale until the next rebuild; rebuilds get slow for large sites; per-user content needs separate requestsBlogs, docs, marketing pages
Hybrid / islandsMostly static speed with interactivity only where needed; choose per pageMore concepts for the team to learn; more decisions to make per pageContent-heavy sites with a few interactive parts, such as e-commerce

What this means for delivery

Rendering affects search visibility, perceived speed, hosting costs and framework choices; performance differences can affect conversion. Measure both content appearance and control readiness on representative devices rather than assuming one renderer is always fastest.

Check your understanding

Quiz

Question 1 of 4

How should this article add a personalized reading-list control?

A public article changes monthly and may wait for a rebuild. Its text must arrive as HTML for readers and search crawlers. A small personalized reading-list control can load afterward. Which plan avoids generating the unchanged article for every visit while still giving each reader their own saved list?

Review questions and explanations (text alternative)
  1. How should this article add a personalized reading-list control?

    A public article changes monthly and may wait for a rebuild. Its text must arrive as HTML for readers and search crawlers. A small personalized reading-list control can load afterward. Which plan avoids generating the unchanged article for every visit while still giving each reader their own saved list?

    • Send an empty shell and build both the text and control with browser JavaScript.
    • Prebuild the article HTML and hydrate a small interactive island for the reading list.
    • Render the complete page on the server for every authorized request, including the article and the reader's reading list.
    • Embed every reader's saved list in the shared prebuilt page so the list needs no later request.

    Suggested answer: Prebuild the article HTML and hydrate a small interactive island for the reading list.

    Prebuilt HTML supplies the article, while an island loads the reader's authorized personal state afterward. An empty client shell omits the required article HTML, and rendering every request adds unnecessary work. A shared build would expose every reader's private list in one public file and cannot be right for each visitor.

  2. Which rendering approach fits a request-specific first view?

    A dashboard behind a login must include the user's current account summary in its initial HTML. The summary is fetched per request and cannot be shared across users. Later filters can run in the browser. Which plan fits, and what cost does it accept?

    • Generate one account summary at build time and share that HTML with every user.
    • Send empty summary markup and fetch the summary in the browser after the initial HTML arrives.
    • Generate each user's summary once daily, accepting that it may not reflect the current request.
    • Render the summary on the server for each authorized request, accepting request-time data fetching and server work.

    Suggested answer: Render the summary on the server for each authorized request, accepting request-time data fetching and server work.

    Current, user-specific data required in initial HTML must be fetched and rendered for the request, adding server computation. Shared output is not user-specific, daily builds may be stale, and client fetching supplies the summary too late. The server must check each request's authorization, and user-specific HTML must not be stored in a shared cache.

  3. What should the team measure when visible controls do not respond?

    A server-rendered page displays its content and filter buttons quickly. On representative low-powered phones, those buttons do nothing until their JavaScript finishes loading and initializing. Which investigation addresses that gap?

    • Use server response time alone as the completion measure for the page.
    • Move the same HTML to build time so existing buttons no longer need initialization.
    • Compare screenshots immediately after first paint to confirm the filters are functional.
    • Record content appearance and control readiness separately; profile JavaScript and hydration.

    Suggested answer: Record content appearance and control readiness separately; profile JavaScript and hydration.

    HTML can appear before hydration makes JavaScript-dependent controls usable. Measure both milestones and investigate the browser work between them. Server timing or screenshots alone cannot establish responsiveness; prebuilding HTML does not remove interactive initialization.

  4. Which approach fits the product pages?

    A store has three kinds of pages: a marketing blog that changes weekly, a dashboard where signed-in sellers manage orders all day, and public product pages that must show current stock and be found by search engines. Which approach fits the product pages?

    • SSG, rebuilding the whole site whenever stock changes so every page stays static.
    • A client-rendered SPA that fetches stock in the browser after an empty page loads.
    • The same approach as the blog, since both kinds of page are public.
    • SSR, so each request gets current stock in HTML that search engines can read.

    Suggested answer: SSR, so each request gets current stock in HTML that search engines can read.

    Product pages must show current stock, and search engines need it in the HTML itself, which rules out a client-only SPA. SSR builds the HTML per request, so stock is current when the page loads. SSG builds it ahead of time, so stock is only as current as the last build. The weekly blog suits SSG; the seller dashboard suits an SPA.