In a single-page web application (SPA), only one web page is loaded, and parts of this page change dynamically as a response to user actions, mimicking desktop applications. There is no need to re-download the entire page as in multi-page applications.
For instance Gmail, Google Maps, Facebook and GitHub are SPAs. Their user interface is a single web page which loads all other content on request.
The LANSA sample web applications are also SPAs with dynamic content inside the mobile app container. In addition, LANSA web applications created with templates are SPAs with dynamically created panels and an app container with a menu used for navigating content:
After the initial load, SPAs are much faster than multi-page applications because the page is downloaded only once, and the components on the page change and load only when required.
Pros of Using SPAs
o SPAs are fast, as most resources are only loaded once throughout the lifespan of application. Only data is transmitted back and forth.
o SPAs can cache any local storage effectively. An application sends only one request, stores all data, then it can use this data and works even offline.
o Keeping the user in one web space optimizes the user experience.
Cons of Using SPAs
o Poor search engine optimization (SEO). SEO in SPAs is difficult because most of the pages are simply not available for scanning by search bots. Therefore SPAs are the best solution for apps in which search engine optimization does not matter.
o Initial page-load times can be slow because the entire client-side has to be loaded upfront.