2 ms·
The basic problem with SPA is simple: 1) Request handling until you have a functional app in, say PHP: GET Reply (page displays at this point) So: 1 RT happe
by candiodari 8y ago
The basic problem with SPA is simple:
1) Request handling until you have a functional app in, say PHP:
GET
Reply
(page displays at this point)
So: 1 RT happens.
2) In an SPA
GET the html
reply
Get the javascript
reply
Get javascript dependencies (usually multiple)
replies
Get the data to display (again usually multiple requests, because nobody does the call combining you should do (ie. don't have GetUserData(), GetFrontpageItems(), GetMessages(). Instead have GetAllStartupStuff() that returns all 3, to avoid the extra roundtrips)
reply
So: 4 RT Minimum
Guess which is the overriding cost in any webapp ?
Yep, the roundtrip.
Guess why we do this SPA thing ?
Why, we do it because it's faster, of course !
(this is so ridiculous it's sad)