Multi-Page Application (MPA)
A multi-page application uses browser document navigation to request and load a new HTML document for each primary route transition.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/multi-page-application/
01What it means
A multi-page application (MPA) is a web delivery architecture where navigation between primary URLs loads new documents from a server or static host. Each response can contain complete usable HTML and may add JavaScript for local interactions. MPA does not mean a site is static, uninteractive, or rendered from hand-written files.[1][2]
- 01Link or formStart standard navigation
- 02Resolve routeServer or static host
- 03Return documentComplete usable HTML
- 04Replace pageInitialize resources and state
- 05Navigate againCache shared assets where possible
An MPA can be dynamic and interactive; the defining boundary is document replacement between primary URLs.
02Why it matters
Document navigation provides built-in URL, history, loading, focus, and failure behavior with a small client runtime. It can simplify delivery and resilience, although full navigations may reset transient state and repeat shared resource work.
03When to use it
Use an MPA for content-led sites, forms, commerce, or workflows whose routes can operate as independent documents. Add client-side islands or enhanced navigation selectively when measured interaction needs justify the additional state and complexity.
04How it works
- Each meaningful route resolves to a server or statically generated document.
- A link or form action starts the browser's standard navigation lifecycle.
- The server or host returns HTML plus referenced styles, scripts, and media.
- The browser replaces the active document and initializes its resources and accessibility state.
- HTTP caching and shared assets reduce repeated transfer across navigations.
05A practical example
A public-service application uses a separate server-rendered document for each eligibility step. Standard forms still submit and recover without client JavaScript, while a small script enhances postcode lookup without taking over routing.
06Where it breaks
Full navigations can interrupt media, clear in-memory state, and feel slower when responses or assets are poorly cached. Complex real-time workspaces may need more client coordination, while careless duplication can increase server-template maintenance.
Common mistakes
- Describing every server-rendered site as static or noninteractive.
- Reloading large uncached assets on every route.
- Storing necessary workflow state only in the outgoing document.
- Adding SPA-style navigation without preserving the MPA's resilience and semantics.
07Sources
- HTML Standard: Loading Web PagesWHATWG · Living web standardHTML Standard: Loading Web Pages
- Rendering on the Webweb.dev · Official technical guidanceRendering on the Web