+ 3
What are single page applications(SPA) and how are they different from normal web application and why we need it.
Nowadays we have seen single page applications ruling the web market so what makes an SPA. How is it different from normal websites. Finally what we need to develop such applications.
3 Réponses
+ 4
Hi Pavan
There are several key concepts related to both SPAs and the newer PWA. Both work on a concept of an App shell, which is skeleton HTML and CSS code.
Second the shell is then dynamically filled with content using web components.
These components change based on your interaction with them, in a 'reactive' manner, rather than you sending down new pages, the server updates these components.
The final key item is the use of Service Workers and offline storage to cache your application shell and and content or code.
Your java script code talks to a service worker instead of the network. The service worker then serves you content from the network or a local in browser database like IndexedDB.
This paves the way to web apps that can work offline or on poor connections.
You may have noticed that many sites are now showing app banners that offer to install to your phone or desktop.
For instance try Starbucks, you can select to add to home screen from the hot dog menu
All modern frameworks like React and Angular offer this way of coding, or you can roll your own with web components like Material Components or Polymer.
+ 2
if you want you can also create a single page application with dynamik content via ajax for the use this way it seems like the page has no loading time
+ 1
Well it is in the name. It's a website defined out of a single page. Most of the time these are just static websites. Which means they are there to just inform you and only do front-end related tasks.
"Normal" web applications can be static too, but you will find many dynamic ones out there too. This means you have a server running which loads data dynamic on the web pages. You can think by yourself what kind of benefits/drawbacks this can have.
Hope this makes things clear for you. If not, just Google or ask again here.