Single-Page Application(SPAs)

The server returns one single, pre-generated HTML page which in turn contains JavaScript code that changes the page dynamically in the browser (this approach is known as a “Single Page Application” or “SPA”). Gmail, Google Maps, Facebook, or GitHub are the examples that we use daily.

SPAs are all about serving an outstanding UX either by using React, angular etc. It is just one web page that you visit which then loads all other content using JavaScript — which they heavily depend on.

PROS

  • Highly reactive, mobile like application as we can use the same backend code for for web and mobile application
  • Only data is transmitted back and forth, so SPAs is fast.
  • SPAs are easy to debug, as network activity can be monitored
  • SPA can cache any local storage. An application sends only one request, store all data, then it can use this data and works even offline

CONS

  • It is very tricky and not an easy task to make SEO optimization of a Single-Page Application. 
  • It is slow to download because heavy client frameworks are required to be loaded to the client.
  • Compared to the “traditional” application, SPA is less secure. Due to Cross-Site Scripting (XSS)
  • Memory leak in JavaScript can even cause powerful system to slow down

Leave a Reply

Your email address will not be published. Required fields are marked *