Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing Vuex Chapter 8

An introduction to SPAs


Contrary to the traditional MPAs, SPAs are designed specifically for web-
based applications. The SPA fetches all the data when you first load the website in the


browser. Once all the data is fetched, you don't need to fetch any more data. When any
other interactions are done, that data is fetched over the internet, without having to send a


request to the server and without reloading the page. This means that SPAs are much faster


than the traditional MPAs. However, since SPAs fetch everything at once on the first load,
the first page load time could be slow. Some applications that have SPA integration are


Gmail, Facebook, GitHub, Trello, and so on. SPAs are all about making the user experience
better by putting the content on one single page and not making the users wait for the


information they want.


The following is a sample diagram of how SPAs work:


The website has all the content that it needs on the first page-load. When a user clicks on


something, it just fetches the information for that particular area and refreshes only that
part of the web page.

Free download pdf