A single page process loads one HTML page, then updates what you see without reloading
A single page process (SPA) is a website that works more like a desktop program than a traditional website. When you first visit it, your browser downloads one HTML page and the JavaScript code that runs it. After that, clicking links, submitting forms, and navigating around the site all happen without the page reloading — the JavaScript updates what's on your screen by fetching new data from the server and changing the HTML in place.
The difference matters because it changes how the site feels to use. A traditional website reloads the entire page every time you click a link, which takes time and can feel choppy. An SPA only loads the pieces that changed, so switching between sections feels when ready. Gmail, Google Maps, Figma, and Slack all work this way — they behave like applications running on your computer, not like pages you're loading from a server.
For developers, building an SPA means using a JavaScript framework like React, Vue, or Angular to manage what appears on the page and handle user interactions. The server's job shrinks: instead of generating HTML pages, it mostly sends data (usually as JSON) that the JavaScript code uses to build the page dynamically. This split between front-end and back-end work is one reason SPAs became popular in the last ten years.
Key Takeaways
- Single page applications load one HTML page once, then use JavaScript to update the content without reloading the browser.
- Navigation and interactions feel faster because only the changed parts of the page update, not the entire page.
- Developers use frameworks like React, Vue, or Angular to build SPAs, which handle updating the page based on user actions and server data.
- The server sends data (usually JSON) rather than complete HTML pages, which means the browser does more of the work to render what you see.
- SPAs work well for complex, interactive applications but require more JavaScript to run, which can slow down the initial page load.
How the browser and server divide the work
In a traditional website, the server builds the entire HTML page and sends it to your browser. Every time you click a link, the server builds a new page and sends it. Your browser has to parse the HTML, load stylesheets and images, and render everything from scratch. This works fine for straightforward sites, but it means a lot of waiting.
In an SPA, the server sends the HTML and JavaScript code once. After that, the JavaScript code runs in your browser and handles most of the work. When you click a link or submit a form, the JavaScript code sends a request to the server asking for data — usually in JSON format, which is lightweight and fast to parse. The JavaScript then takes that data and updates the HTML on the page without reloading.
This shift means the browser does more work, but it also means the server can handle more users with the same hardware, because it's not building and sending complete HTML pages for every request. The trade-off is that the initial page load takes longer, because your browser has to read and run all the JavaScript code before the page becomes interactive.
Why developers choose to build single page applications
SPAs feel faster and more responsive because navigation doesn't require a full page reload. Users see changes when ready, which makes the experience feel smoother. For applications where users spend a long time interacting with the same page — like email, project management tools, or maps — this responsiveness matters a lot.
SPAs also make it easier to build complex, interactive features. A framework like React lets developers write code that automatically updates the page when data changes, without manually writing code to update the HTML. This reduces bugs and makes the codebase easier to maintain as the process grows.
Another reason is that SPAs work the same way on desktop and mobile. The same JavaScript code can run in a browser on your phone or computer, so developers don't have to build separate versions. This saves time and money, which is why many startups and large companies choose to build SPAs.
The cost of single page applications: initial load time and complexity
The main downside is that the initial page load is slower. Your browser has to read the HTML, all the JavaScript code, and any stylesheets before it can show you anything interactive. For a straightforward site, this might mean waiting an extra second or two. For a complex process, it can mean waiting five to ten seconds or more before the page becomes usable.
This slowness affects search engines too. Traditional websites send complete HTML to search engines, so Google and Bing can when ready see and index the content. SPAs send mostly empty HTML and rely on JavaScript to build the page, which search engines have to wait for and execute. This makes it harder for search engines to index SPA content, though Google has gotten better at this in recent years.
Building an SPA also requires more informed. Developers need to understand JavaScript frameworks, how to manage state (the data that controls what appears on the page), and how to communicate with servers. This means SPAs cost more to build and maintain than simpler websites.
Common JavaScript frameworks for building single page applications
React, made by Meta (Facebook), is the most widely used framework for building SPAs. It focuses on managing what appears on the page based on data, and it has a large community and many tools built around it. React is used by Facebook, Netflix, Airbnb, and thousands of other companies.
Vue is smaller and easier to learn than React, with a gentler learning curve for developers new to SPAs. It's popular for smaller projects and startups, and it's used by companies like Alibaba and Xiaomi.
Angular, made by Google, is a complete framework that includes everything needed to build large applications. It's more opinionated than React or Vue, meaning it makes more decisions for you about how to structure your code. It's popular in large enterprises and companies that need strict structure and consistency.
Svelte is a newer framework that takes a different approach: it compiles your code to plain JavaScript at build time, rather than running a framework in the browser. This means Svelte applications can be smaller and faster than React or Vue applications, though the ecosystem is smaller.
When single page applications make sense and when they don't
SPAs work well for applications where users interact with the same page for a long time: email clients, project management tools, maps, chat applications, and design tools. They also work well for mobile apps built with web technology, because the same code can run on iOS and Android.
SPAs don't work as well for content-heavy websites like blogs, news sites, or documentation. These sites benefit from fast initial load times and good search engine visibility, which SPAs struggle with. A traditional website or a hybrid approach (where the server renders the initial page and JavaScript takes over after that) usually works better.
Some developers use a hybrid approach called server-side rendering (SSR), where the server builds the initial HTML page so it loads fast and search engines can see it, but JavaScript takes over after that to make navigation feel like an SPA. This combines the benefits of both approaches, but it's more complex to build and maintain.
How single page applications handle browser history and bookmarks
One challenge with SPAs is that they don't naturally work with the browser's back button or bookmarks. When you click a link in a traditional website, the URL changes and the browser saves that URL in history. In an SPA, the URL might not change, so the back button doesn't work and you can't bookmark a specific section of the process.
Modern SPAs solve this by using the browser's History API, which lets JavaScript change the URL without reloading the page. When you navigate to a new section, the JavaScript code updates the URL in the address bar and saves it in the browser's history. This makes the back button work and lets you bookmark specific sections.
Developers have to build this behavior explicitly — it doesn't happen automatically. This is one reason why building an SPA requires more work than building a traditional website.
Frequently Asked Questions
Is a single page process the same as a progressive web app?
No, but they're related. A progressive web app (PWA) is a website that works offline and can be installed on your home screen like an app. Many PWAs are built as SPAs, but you can also build a PWA as a traditional website. The two concepts solve different problems.
Do single page applications work without JavaScript?
No. An SPA requires JavaScript to run in your browser. If JavaScript is disabled or fails to load, the page will be blank or mostly non-functional. This is why some developers avoid SPAs for content that needs to be accessible to everyone.
Why does my single page process feel slow when I first load it?
The initial load is slow because your browser has to read all the JavaScript code before it can show you anything interactive. Once that code is loaded, navigation feels fast because only the data changes, not the entire page. Some developers use code splitting to load only the JavaScript you need for the first page, which speeds up the initial load.
Can search engines index single page applications?
Google can index SPAs, but it takes longer and requires more resources than indexing a traditional website. Bing and other search engines are less reliable at indexing JavaScript-heavy sites. If search visibility is important, server-side rendering or a traditional website usually works better.
What's the difference between a single page process and a traditional website?
A traditional website reloads the entire page every time you navigate, while an SPA updates only the parts that changed. Traditional websites are faster to load initially and easier for search engines to index. SPAs feel faster to use once loaded and work better for complex, interactive applications.