Sunday, January 3, 2021

SPA vs MPA - Single Page App vs Multi Page App

https://www.youtube.com/watch?v=F_BYg2QGsC0















MPA vs SPA - MultiPage Application vs SinglePage Application
Multipage Application  - New Html-File for every Request - PHP/NodeJs/JSP - Server Side Renders Your HTML page to browser - e.g -  www.nytimes.com
Spinner Spins here, everytime.

angular.io 
Reload Icon Does not changes at all - No Page Fetch Happening - "No Spinner" there
1st Time -  Lots of JS, Assests/CSS/Images, 1 HTML Page gets downloaded
There would be never be another HTML Page .
Javascript - Helper Framework - Angular, React, Vue
at each click - It fetches JSON Date - Javascript parses - 
Then JS listens to all activities like click and performs DOM Manipulation

Single Page Application Always Better than MPA ? 
No. Not every time.
Lets consider pros and Cons.

::SPA ::                                                  
SuperFast/Very Responsive/Desktop App - Slack                   
Decoupled Frontend - Styling - ServerSide Code is  just API - not the "Server Side Rendering"
SEO is a Challenge - (Asynchronously Data- Web Crawler)
Javascript is absolutely needed
Older Browser not favoured out of box

::MPA::
SEO - Big Advantage!!! - Crawler Sees , What User Sees
Vast Support , Doc
Slow - Load Pages
Tight/Some level of Coupling of Backend - Frontend => "Server Side Page Rendering"


No comments:

Post a Comment

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass