What is a SPA and what your site gains (and loses) with it
Published on 2026-09-12 by frfrand
A single page that rewrites itself: what problem it solves, why it broke the back button for years, what happens with SEO, and when it's best not to use it.

Short answer: an SPA (Single Page Application) loads a single HTML document and then rewrites the screen with JavaScript, without requesting new pages. It gains instant navigation and state that survives between screens; it pays a heavier initial load, having to handle history and titles, and empty previews if it isn't prerendered. It's suitable where people work, not where they read.
SPA stands for Single Page Application: single-page application. The name describes the mechanism, not the experience.
There is a single HTML document. When you navigate, no new page is requested: JavaScript intercepts the click, requests the data it needs, and rewrites part of what is already on screen.
What problem it came to solve
In classic web, every click discards everything and starts from scratch. That's perfect for reading articles and uncomfortable for working.
If you're on a panel with a filter applied, a sidebar open, and a form half-filled, every full navigation erases all that context. SPAs appeared so the web would be more like a desktop application, where state survives.
What you gain
Navigation without blinking. Once loaded, changing sections is instant: only a small JSON travels, not an entire document.
State survives. A player that keeps playing while you navigate, a cart that isn't lost, a filter that remains applied.
The server sends less. It returns data, not HTML. That same thing works for the mobile app without duplicating anything.
What you pay for
The first load. You have to download the JavaScript and execute it before seeing anything. On a good connection and a powerful device it's barely noticeable; on an old phone with a slow network it can be several seconds of a blank screen.
You take charge of the browser. Everything the browser did for free becomes your responsibility: the back button, history, tab title, scrolling when changing screens, loading and error states.
For years SPAs had a bad reputation precisely because of this: they broke the back button. Today routers solve it well, but it's still something you have to do on purpose.
The content is not in the HTML. This affects two different things that get confused:
- Search engines: Google executes JavaScript and indexes the same, although more slowly. It's not the disaster it used to be.
- Previews when sharing: here it does hurt. When you paste a link in a chat or social network, what generates the card almost never executes JavaScript. If your title and description are set by the script, the preview comes out empty. It's the most common problem and the least anticipated.
The solution almost everyone uses
Prerendering: generating, at the time of publishing, an HTML version of each public route with its title, description, and content.
Visitors get the full SPA and still have instant navigation. Search engines and preview generators get real HTML. You don't have to choose.
It's exactly what we do on the ArduMaker site: every public route is prerendered at build time, and the app mounts on top when the browser finishes loading.
When it's not worth it
If your site is content to read (a blog, documentation, a landing page), the SPA adds complexity without benefit. A static site generated at publish time is faster, cheaper, and harder to break.
The simple rule: if people read it, you don't need an SPA. If people work inside it, they probably do.


A SPA in production needs correct routes and caching
When publishing a SPA, if the user visits /perfil directly, the server must return the application and let the frontend router resolve that route. Without this configuration, internal navigation may work while reloading the page returns 404.
On an ArduMaker VPS you can publish the compiled files as a static process of the deploy from GitHub; with the SPA fallback option (spa_fallback), the generated server block returns index.html for any route that is not a file (try_files $uri $uri/ /index.html). Also, it is convenient to cache versioned files carefully without keeping an obsolete index.html indefinitely.
Related: SSR vs SSG · What is Nginx.
Frequently Asked Questions
Is an SPA bad for SEO? Not as much anymore: Google executes JavaScript and indexes it, though more slowly. The real problem is link previews, because those generators almost never run scripts. Prerendering public routes solves it.
Why does reloading /perfil show a 404? Because the server looks for a /perfil file that doesn't exist. You need to configure it to return the application's index.html and let the frontend router resolve the route.
What is prerendering? Generating, at build time, a real HTML of each public route with its title, description, and content. Visitors receive the full SPA and crawlers receive readable HTML.