How client-side routing keeps the app on one document
When a user clicks a link, an SPA stops the browser from loading a new page, fetches the new content and puts it into the current page. In the strict form that the Next.js docs describe, one HTML file such as index.html serves the whole app. Client-side JavaScript changes the DOM of the current page and does not request a new document for each route. Because users do not load whole new pages from the server, an SPA can bring performance gains and a more dynamic experience. Pagepro builds such apps as part of its custom web app development services.
history.pushState() adds a new entry to the session history without a page load. Without such entries, the Back button would take the user out of the SPA. When the user presses Back or Forward, the browser fires a popstate event, and the app can restore the matching content.
MDN lists React, Angular and Vue.js as popular SPA frameworks. Unlike a strict SPA, Next.js can split JavaScript bundles automatically and generate multiple HTML entry points into different routes. Interface work in React or Next.js is described on the front-end development services page.
Routes, 404s and Core Web Vitals: what an SPA changes for SEO
MDN's SPA definition lists SEO, more effort to maintain state and implement navigation, and meaningful performance monitoring as trade-offs.
Routing. Google says SPAs with client-side routing should use the History API to route between views. Fragments should not load different page content, because Googlebot cannot reliably resolve such URLs.
Missing pages. With client-side routing, a meaningful HTTP status code for a missing page can be impractical or impossible. To avoid a soft 404, Google suggests a JavaScript redirect to a URL for which the server responds with a 404 status code, such as
/not-found. The other option is anoindexrobots meta tag added to error pages with JavaScript.Load cost. A strict SPA often has to load a large amount of JavaScript before the page becomes interactive, the Next.js docs say.
Measurement. web.dev's Core Web Vitals FAQ for SPAs, updated in October 2026, reports that new APIs in Chrome 151 can measure Core Web Vitals on SPA sites. Browser engines other than Chromium do not support these APIs yet.
The same FAQ states that Google has no preference for either architecture and that both SPAs and multi-page applications can deliver high-quality experiences. The metrics themselves are explained in Core Web Vitals: How to Measure and Improve Them.
Sources
- SPA (Single-page application)MDN · developer.mozilla.org
- Working with the History APIMDN (Mozilla) · developer.mozilla.org
- Client-side rendering (CSR)MDN · developer.mozilla.org
- How to build single-page applications with Next.jsNext.js · nextjs.org
- Understand the JavaScript SEO basicsGoogle Search Central · developers.google.com
- How SPA architectures affect Core Web Vitalsweb.dev (Google) · web.dev