On the screen

Rendering and architecture

Every page has to be turned into HTML at some point. That can happen in the visitor's browser, on a server when the page is requested, or ahead of time when the site is built, and the choice shapes how fast the page appears, how well search engines read it and what it costs to host.

Around that sit bigger decisions about the shape of an app: one page that swaps its contents or many separate pages, an installable web app that works offline, one codebase or many small services. The patterns at the end, such as optimistic updates and local-first data, decide how quick an app feels in use.

16 terms · 3 comparisons · prices checked September 2026

16 terms, click any to open

Where pages are built

Client-side rendering (CSR)

Concept
The server sends a nearly empty page plus JavaScript, and the visitor's browser builds the content itself. It suits app-like screens behind a login.

With CSR the first HTML is little more than a script tag and an empty container. The browser downloads the JavaScript bundle, runs it, fetches data from an API and only then draws the page. After that first load, moving between screens is quick, because only data travels, not whole pages.

The costs come at the start: visitors see a blank screen or a spinner until the bundle has loaded, slow phones feel it most, and search engines and link previews may see little content. Google can run JavaScript, but most social media crawlers cannot. CSR is the default for single-page apps built with Vite, and frameworks let individual routes opt into it.

Pros

  • Fast, app-like navigation once the app has loaded
  • Simple hosting: static files on any CDN
  • No server rendering to pay for or maintain
  • Clear split between the frontend and the API

Cons

  • Blank screen or spinner until the JavaScript loads
  • Weak for SEO and link previews without extra work
  • Large bundles hurt slow phones and networks

Pick it when

  • Dashboards, admin panels and tools behind a login
  • Highly interactive apps such as editors and design tools

Skip it when

  • Public pages that must rank in search or share well on social media
  • Many visitors arrive on slow phones or networks

Also called: CSR, client rendering, browser rendering

Open Client-side rendering (CSR) as a page

Server-side rendering (SSR)

Concept
The server builds the full HTML for a page each time someone asks for it, so content appears straight away and search engines can read it.

When a request arrives, the server fetches the data, renders the components to HTML and sends a complete page. The browser can show it immediately; then the JavaScript loads and hydrates the page to make buttons and forms work. Because the page is built per request, it can be personalised, for example to show the signed-in user's basket.

This is how PHP, Rails and Django sites have always worked, and frameworks such as Next.js, Nuxt, SvelteKit and React Router bring it to component-based apps. Streaming lets the server send the page in pieces, so slow parts do not hold up the rest. The trade-off is a server doing work on every request, which costs money and adds delay when it sits far from the visitor or the data.

Pros

  • Content is visible quickly, even before JavaScript runs
  • Search engines and link previews see the full page
  • Fresh, personalised data on every request
  • Secrets and heavy logic stay on the server

Cons

  • A server works on every request, which costs money
  • Slower than static pages when the server or data is far away
  • Hydration still ships JavaScript for interactivity
  • More moving parts: caching, timeouts and server errors

Pick it when

  • Pages that change per visitor or per request, such as search results
  • Stores and listings that need both SEO and fresh stock or prices
  • Signed-in pages that must also load quickly

Skip it when

  • Pages that are the same for everyone and rarely change (use SSG)
  • Very high traffic, where serving cached static pages is far cheaper

Also called: SSR, server rendering, dynamic rendering

Open Server-side rendering (SSR) as a page

Static site generation (SSG)

Concept
Every page is built into plain HTML files once, when the site is published, and then served as it is from a CDN, which is quick and cheap for pages that are the same for everyone.

At build time the framework fetches the data (from Markdown files, a CMS or an API), renders every page and writes out HTML, CSS and JavaScript files. Those files go to a CDN, which serves them from a location near each visitor with no server work per request. Astro, Next.js, Nuxt, SvelteKit, Hugo and Eleventy can all do this.

The catch is freshness: a change goes live only after a rebuild, and sites with tens of thousands of pages can take a long time to build. Incremental static regeneration and on-demand revalidation solve much of that. Interactive parts such as search or a basket still work through JavaScript and APIs.

Pros

  • Very fast pages, served straight from a CDN
  • Cheap or free hosting, with very little that can break
  • Strong for SEO and Core Web Vitals
  • Small attack surface, since no live server code runs

Cons

  • Content updates need a rebuild and a redeploy
  • Build times grow with the number of pages
  • Per-visitor content needs extra client-side code

Pick it when

  • Marketing sites, blogs, docs and portfolios
  • Content that changes daily or less often
  • Landing pages that must load quickly everywhere

Skip it when

  • Pages that differ for every visitor or change every minute
  • Very large catalogues where full rebuilds take too long (consider ISR)

Also called: SSG, static rendering, prerendering, static site

Open Static site generation (SSG) as a page

Incremental static regeneration (ISR)

Concept
Static pages that rebuild themselves in the background after a set time or when their content changes, giving a site static speed without full rebuilds.

A page is generated once and cached like a static file. With a revalidate time of, say, 60 seconds, the first visitor after that minute still gets the cached page instantly while the server rebuilds it in the background, and the next visitor sees the fresh version. On-demand revalidation lets a CMS or a webhook refresh one page the moment its content changes.

Next.js introduced the term, and similar features exist in Nuxt route rules, SvelteKit on Vercel and plain CDN cache headers (stale-while-revalidate). Pages not built ahead of time can be generated on their first request. It needs a host that supports it: Vercel and Netlify handle it automatically, while self-hosting on several servers needs a shared cache.

Pros

  • Static speed with content that stays reasonably fresh
  • No full rebuild when one page changes
  • Handles huge catalogues by building pages on first request

Cons

  • Some visitors see slightly out-of-date content
  • Caching behaviour is harder to reason about and debug
  • Needs host support, and self-hosting takes extra setup

Pick it when

  • Large stores, listings and news sites
  • CMS-driven sites where editors publish often

Skip it when

  • Data must be exact and live for every visitor (use SSR)
  • A small site, where a quick full rebuild is simpler

Also called: ISR, revalidation, on-demand revalidation, stale-while-revalidate

Open Incremental static regeneration (ISR) as a pageOfficial site (opens in a new tab)

Hydration

Concept
The step where JavaScript in the browser takes over server-rendered HTML and wires up the buttons, forms and state, so the page becomes interactive.

Server rendering and static generation send finished HTML, but it does nothing until the framework loads, rebuilds its component tree in memory, matches it against the existing HTML and attaches event handlers. Until hydration finishes, a page can look ready but ignore taps. If the server and browser render different output (a date or a random value, for example), a hydration mismatch warning appears and parts of the page may re-render.

Because hydrating a whole page is costly, newer approaches do less of it: islands (Astro) hydrate only the interactive components, selective hydration (React) handles first what the user touches, Server Components never hydrate at all, and resumability (Qwik) skips the step entirely.

Also called: rehydration, partial hydration, islands, resumability

Open Hydration as a page

React Server Components

Concept
React components that run only on the server, fetch their own data and send the finished result to the browser without their code, so pages ship less JavaScript.

A Server Component can be async, read a database or call an API directly, and render the result. Its code never reaches the browser; React sends a compact description of the output, which the browser merges into the page. Components that need state or event handlers are marked 'use client' and hydrate as usual, and the two kinds can be nested inside each other.

Server Functions, marked 'use server', let browser code call server logic, such as saving a form, without writing an API route. Server Components became stable in React 19. The App Router in Next.js is the most widely used implementation, and frameworks such as React Router and Waku support them to varying degrees.

Code that the browser can reach on the server is an attack surface: in December 2025 a critical flaw known as React2Shell in the protocol behind Server Components allowed remote code execution, and fixing it meant upgrading React and Next.js straight away.

Pros

  • Less JavaScript sent to the browser
  • Data fetching sits next to the component that needs it
  • Secrets, database access and heavy libraries stay on the server
  • Server Functions remove much API boilerplate for forms

Cons

  • A new mental model: which code runs where is easy to confuse
  • Caching and debugging are harder than in a plain single-page app
  • Tied to frameworks that support it, mainly Next.js
  • Server endpoints exposed to browsers need prompt security patching

Pick it when

  • Content-heavy React apps where bundle size and SEO matter
  • Pages that combine lots of server data with small interactive parts

Skip it when

  • Fully interactive apps behind a login, where a Vite single-page app is simpler
  • Teams not ready to learn the boundary between server and client code

Also called: RSC, Server Components, use client, use server, Server Functions

Open React Server Components as a pageOfficial site (opens in a new tab)

App shapes

Single-page app (SPA)

Concept
A web app that loads one page once and then swaps content in place with JavaScript as you move around, so it feels like a desktop or phone app.

In a SPA the browser downloads the app once. Clicking a link does not load a new document; a client-side router changes the URL with the History API and redraws only the parts that differ, fetching data from an API as needed. Gmail and most admin dashboards work this way.

SPAs usually render on the client, which brings the CSR trade-offs: a slower first load and weaker SEO unless a framework adds server rendering. They also have to handle things browsers give multi-page sites for free, such as scroll position, focus after navigation and announcing page changes to screen readers.

Pros

  • Smooth, app-like navigation without full page reloads
  • State such as open panels or playing audio survives navigation
  • Static hosting on any CDN, with the API kept separate

Cons

  • Slower first load while the JavaScript bundle downloads
  • SEO and link previews need extra work
  • Must rebuild browser basics: focus, scroll and accessibility on navigation

Pick it when

  • Dashboards, tools and apps where people stay a long time
  • Rich interactivity with state that should survive navigation

Skip it when

  • Content sites whose visitors read one or two pages and leave
  • Search traffic is the main source of visitors

Also called: SPA, single page application

Open Single-page app (SPA) as a page

Multi-page app (MPA)

Concept
A website where each link loads a new page from the server, the classic way the web works. It is simple, robust and easy for search engines to read.

Each URL is its own HTML document, rendered on the server or at build time. Clicking a link makes the browser fetch and show the next page, with history, scrolling and accessibility handled by the browser itself. WordPress, Laravel and Django sites, and most static sites, are MPAs.

The old downsides, a flash between pages and lost state, have shrunk: browsers cache pages well, cross-document view transitions can animate between pages in Chrome, Edge and Safari, and tools such as htmx or small islands of JavaScript add interactivity where it is needed. Frameworks such as Astro build MPAs on purpose.

Pros

  • Fast first load and strong SEO by default
  • Simple mental model: the browser handles history and focus
  • Keeps working when JavaScript fails or loads slowly
  • Each page can be cached separately on a CDN

Cons

  • Full page loads between screens, which can feel slower
  • State such as a playing video resets on every navigation
  • Rich, app-like interactions need extra JavaScript

Pick it when

  • Content sites, blogs, stores and marketing pages
  • Sites where SEO and reliability matter more than an app-like feel

Skip it when

  • Long sessions with rich interaction, such as editors or dashboards

Also called: MPA, multi page application, traditional website

Open Multi-page app (MPA) as a page

Progressive web app (PWA)

Concept
A website that can be installed on a phone or computer like an app, with its own icon and window, and can keep working offline.

A PWA is a normal website plus two things: a web app manifest (a JSON file with the name, icons and colours) and a service worker that caches files and data so pages load without a connection. Served over HTTPS, it can be installed from the browser to the home screen or desktop, opens in its own window and, on most platforms, can receive push notifications.

Support varies by platform. Chrome and Edge on Android and desktop offer an install prompt; iPhones and iPads install through Share, then Add to Home Screen, and have supported web push for installed apps since iOS 16.4. A PWA can also be listed on Google Play as a Trusted Web Activity, or in the Microsoft Store. It cannot reach every device feature a native app can, such as some Bluetooth, background and widget abilities.

Pros

  • One codebase for web, Android, iOS and desktop
  • No app store needed, and updates arrive instantly
  • Works offline and on flaky connections
  • Usually cheaper than building separate native apps

Cons

  • Support on iPhone and iPad is more limited than on Android
  • Less access to device features than native apps
  • Harder to discover than a store listing unless published there too

Pick it when

  • Tools people return to often, such as booking or ordering apps
  • Budgets that cannot stretch to separate native apps
  • Field or shop-floor use with patchy internet

Skip it when

  • The app depends on deep device features or long background work
  • A store presence and a native look are central to the product

Also called: PWA, installable web app, web app manifest

Open Progressive web app (PWA) as a pageOfficial site (opens in a new tab)

Service worker

API
A script that the browser runs in the background for a website, sitting between the page and the network so it can serve cached files offline and receive push messages.

A page registers a service worker file, which the browser installs and keeps separately from any open tab. It can intercept every network request from the site and decide whether to answer from the Cache Storage API, go to the network, or both, which is how offline pages and instant repeat visits work. It also receives push notifications and background sync events while the site is closed.

Service workers run only over HTTPS (or on localhost) and cannot touch the page's DOM. Caching strategies are easy to get wrong, and a faulty worker can keep serving stale files for a long time, so most teams use Workbox or a framework plugin. Browser extensions built on Manifest V3 also use a service worker as their background script.

Also called: Workbox, offline cache, sw.js

Open Service worker as a pageOfficial site (opens in a new tab)

Jamstack

Concept
An approach to building websites from pre-built static pages served by a CDN, with dynamic features added through JavaScript and third-party APIs.

The name stood for JavaScript, APIs and Markup. Pages are generated ahead of time (SSG) and deployed to a CDN, and anything dynamic, such as forms, search, payments or comments, is handled by JavaScript calling APIs or serverless functions. Netlify popularised the term in the late 2010s, alongside static site generators and headless CMSs.

The ideas spread, but the label faded. Modern frameworks mix static pages, server rendering and edge functions route by route, so few projects describe themselves as Jamstack any more. The core advice still holds: pre-render what you can, serve it from a CDN, and keep servers for the parts that need them.

Also called: JAMstack, JAM stack

Open Jamstack as a page

Architecture

Monolith

Pattern
An application built and deployed as one unit, with all its features in a single codebase and usually one database. It is the usual starting point for new products.

In a monolith, the web pages, API, background jobs and business logic live in one project and ship together. Calls between features are ordinary function calls, a single database transaction can cover several features, and there is one thing to build, test, deploy and monitor. Rails, Laravel and Django apps, and a Next.js app with its API routes, are typical monoliths.

Problems appear with size: a big codebase gets slow to build and risky to change, and one busy feature cannot be scaled on its own. A modular monolith, with clear boundaries between features inside the one codebase, keeps most of the simplicity while leaving a later split possible. Some well-known teams have moved back from microservices to a monolith after finding the overhead too high.

Pros

  • Simple to build, test, deploy and debug
  • Fast calls and easy transactions across features
  • One codebase that a small team can understand
  • Cheaper to host and monitor

Cons

  • Large codebases get slow to build and risky to change
  • One feature cannot be scaled or deployed on its own
  • One bad bug or deployment can take everything down

Pick it when

  • New products, startups and small to medium teams
  • Most business apps, stores and SaaS products
  • You are still learning where the natural boundaries lie

Skip it when

  • Many independent teams must release separately and often

Also called: monolithic architecture, modular monolith

Open Monolith as a page

Microservices

Pattern
An architecture that splits an application into many small services, each owning one business area, running separately and talking to the others over the network.

Each service, such as accounts, payments, search or notifications, has its own codebase, its own database and its own deployments, and talks to the others through APIs (REST, gRPC) or message queues. Teams can pick the language that suits each service, release on their own schedule and scale only the parts under load, usually with containers on Kubernetes or on serverless platforms.

The price is complexity. Network calls fail and add delay, data spread across many databases is hard to keep consistent, and following one request through many services needs proper monitoring and tracing. Microservices mostly solve an organisational problem, many teams working on one product, which is why they tend to pay off at large scale rather than at the start.

Pros

  • Teams release and scale their services independently
  • A failure can be contained to one service
  • Each service can use the technology that suits it
  • Smaller codebases that are easier to understand one at a time

Cons

  • Much more operational work: deployment, monitoring and tracing
  • Network calls add delay and new ways to fail
  • Keeping data consistent across services is hard
  • Expensive in infrastructure and people for small teams

Pick it when

  • Large organisations with many teams working on one product
  • Parts of a system with very different scaling or reliability needs

Skip it when

  • A new product or a small team (start with a monolith)
  • You lack the monitoring and DevOps skills to run many services

Also called: microservice architecture, SOA, distributed services

Open Microservices as a page

MVC and MVVM

Pattern
Two classic ways to organise an app's code by separating the data and rules (the model) from what the user sees (the view) and the glue between them.

In MVC, a controller receives a request or input, works with the model (data and business rules) and picks a view to render. Web frameworks such as Laravel, Rails, Django (which calls it MTV), ASP.NET MVC and Spring MVC are built around it. In MVVM, a view model holds a screen's state and actions, and the view binds to it and updates automatically when it changes.

MVVM came from Microsoft's desktop frameworks and is now the usual pattern for Android apps built with Jetpack Compose and ViewModel, and common in SwiftUI apps. Component frameworks such as React blur the lines, but the core idea, keeping business logic out of the interface code, still makes an app easier to test and change.

Also called: MVC, MVVM, Model-View-Controller, Model-View-ViewModel, ViewModel

Open MVC and MVVM as a page

Patterns

Optimistic UI

Pattern
Showing the result of an action straight away, such as a like or a sent message, before the server confirms it, and quietly undoing it if the request fails.

Most requests succeed, so instead of showing a spinner the app updates the screen immediately and sends the request in the background. If the server rejects it, the app rolls back to the previous state and tells the user. The result feels instant even on slow connections.

React's useOptimistic hook, TanStack Query's onMutate callback and similar tools in other frameworks handle the bookkeeping. It suits likes, list edits, reordering and chat messages; it does not suit payments, bookings or anything where showing success too early would mislead.

Also called: optimistic updates, useOptimistic

Open Optimistic UI as a page

Local-first

Pattern
Apps that keep the main copy of your data on your own device, so they respond instantly and work offline, and sync with other devices and people in the background.

A local-first app reads and writes a database on the device, such as SQLite or IndexedDB, so every action is immediate and nothing waits on the network. A sync engine sends changes to a server or to other devices whenever a connection exists. When two people edit the same thing offline, conflict-free replicated data types (CRDTs), used by libraries such as Yjs and Automerge, or rules on the server merge the edits.

The term comes from a 2019 essay by the research lab Ink & Switch, and apps such as Linear and Obsidian are often cited as examples. Sync services such as PowerSync, ElectricSQL and Dexie Cloud do much of the hard work for web and mobile apps. It changes the role of the backend: the server becomes a place to sync and back up, not the only source of truth.

Pros

  • Instant responses, because nothing waits for the network
  • Works fully offline and on poor connections
  • Users keep their data even if the service changes
  • Real-time collaboration follows naturally from sync

Cons

  • Sync and conflict resolution are hard to get right
  • Access control and data migrations are more complex
  • Large datasets may not fit on every device

Pick it when

  • Notes, task and field-work apps used offline or on the move
  • Collaborative editors and design tools
  • Apps where the speed of every interaction matters

Skip it when

  • Data that must be checked centrally first, such as payments or stock levels
  • Simple content sites or forms with little data to keep

Also called: local-first software, offline-first, CRDT, sync engine

Open Local-first as a pageOfficial site (opens in a new tab)

Side by side

Differences

How the options in this area compare on the questions that usually decide the choice.

Four answers to one question: when is a page's HTML built? In the browser, on the server for each request, once at build time, or at build time with refreshes in the background.

CompareCSRSSRSSGISR
HTML is builtIn the browserOn the server, per requestAt build timeAt build time, then refreshed
First viewSlow: waits for JavaScriptFastVery fast, from a CDNVery fast, from a cache
SEOWeak without extra workStrongStrongStrong
Data freshnessLive, fetched in the browserLive on every requestAs of the last buildRefreshed on a timer or on demand
Server costNone: static filesWork on every requestNone after the buildSmall: occasional rebuilds
Personalised pagesYes, in the browserYesNo, same for everyoneNo, same for everyone
Typical useDashboards behind a loginSearch results, feeds, basketsBlogs, docs, marketing pagesLarge stores and news sites

How to choose

  • Pick SSG for pages that are the same for everyone and change rarely.
  • Pick ISR when those pages are numerous or change often, and a few minutes of staleness is acceptable.
  • Pick SSR for pages that must be fresh or personalised on every request.
  • Pick CSR for app screens behind a login, where search engines do not matter.

Single-page app vs multi-page app

Open as a page: Single-page app vs multi-page app

Does the browser load one page and swap its contents, or load a new page for every link? The choice affects speed, SEO and how much the app has to handle itself.

CompareSPAMPA
How navigation worksJavaScript swaps content in placeThe browser loads a new page
First loadSlower: the whole app downloadsFaster: one page at a time
Moving between pagesInstant feel, no reloadsFull load, softened by caching
SEONeeds server rendering or prerenderingStrong by default
State between pagesKept (players, open panels)Reset on each page
Accessibility basicsMust be rebuilt: focus, titles, scrollHandled by the browser
Typical toolsReact, Vue or Svelte with ViteWordPress, Laravel, Astro
Best forDashboards and long sessionsContent sites and stores

How to choose

  • Pick a SPA for app-like tools where people stay a long time and search traffic does not matter.
  • Pick an MPA for content, stores and marketing sites that depend on search traffic.
  • Frameworks such as Next.js and Nuxt blend the two: server-rendered pages that then navigate like a SPA.

One deployable application or many small ones. The choice is less about technology than about team size and how independently the parts of a product need to change.

CompareMonolithMicroservices
StructureOne codebase, one deploymentMany services, deployed separately
DatabaseUsually one shared databaseEach service owns its data
Calls between featuresFunction calls, fast and reliableNetwork calls that can fail
ScalingThe whole app scales togetherEach service scales on its own
Team fitOne team or a fewMany independent teams
OperationsSimple: one thing to monitorHeavy: tracing, orchestration, many pipelines
Cost to startLowHigh
Main riskTangled code as it growsDistributed complexity too early

How to choose

  • Start with a monolith, ideally a modular one with clear internal boundaries.
  • Split out a service when one part has clearly different scaling needs or a team needs to release on its own.
  • Move to microservices broadly only when team size, not technology, makes the monolith the bottleneck.

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.