Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What actually is Single Page Application(SPA)?

Here is my understanding about SPA.

Its an application where user gets the feeling that he is on the same page in response to any user triggered event. Basically whole page won't be submitted , an ajax request will be triggered in backgroung for an event and response will be rendered on same page. So its fast(as whole page is not submitted) and more responsive(there is no blank screen even for iota of time even when ajax request is in process, which means there will/can be some screen user can still take action )

So as per my understanding any web application which is completely based on ajax and no where submitting the whole page like document.form.submit (which is synchronous) is a single page application whether its using controllers, routing etc or not. Is that correct ?

I have gone thru SPA wiki and got the feeling that application is which is completely based out of ajax may not be SPA if it is not using controllers, routing etc

like image 275
M Sach Avatar asked Mar 29 '15 12:03

M Sach


1 Answers

@MSach. Whatever you wrote for SPA is quite correct in addition,

  • First of all, a SPA is a web app which actually fits on a single webpage providing a great user experience and loading everything's that is needed on that first page.
  • A SPA is also ideal for a rich user experience which keeps the user really engaged in the application by keeping the pages moving fluently because of the client side navigation and just as important as the other two is reduced round tripping which means they'll make less trips between the client and server and less post backs of the entire page.
  • A SPA often will persist important state in the client too whether it's in cache, in memory of the browser, or off to local storage.You can load what you need both data and views on the initial load but just the pieces that the user is absolutely going to use right away and then later you can load the rest of it on demand asynchronously. And then as the user goes to other parts of the application, we can progressively download other features and data as needed.
  • Apps like Facebook and Gmail both have SPA characteristics and there are some other apps too that are SPAs.
like image 104
ashishraaj Avatar answered Oct 23 '22 05:10

ashishraaj