3 ms·
The idea of SPA, is to not have to send 'useless' data at every page change (like the HTML layout), but only the strict necessary data with a JSON payload. Espe
by z0mbie42 7y ago
The idea of SPA, is to not have to send 'useless' data at every page change (like the HTML layout), but only the strict necessary data with a JSON payload. Especially coupled with good caching.
Also it offloads computation done on the server to clients (templating).
So generally yes SPA are heavier, but they are more powerful. It's a matter of tradeoffs.
- SamWhited 7y agoOr you could just make the HTML and what not simpler and then who cares? The useless data is fine if you don't already have the problem of sending tons of extra crap that nobody needs. Single page stuff can still use templating on the server side.
- rsynnott 7y agoAs long as they've existed, SPAs have been faster, but only in theory ;) I don't think I've _ever_ seen one that's faster than the normal webapp it replaced. Except possibly for Google's first attempt on gmail, which was pretty snappy. Fortunately they've since replaced it with a sluggish behemoth, so order has been restored to the universe.
- SamWhited 7y agoWith the possible exception you mentioned (I switched to FastMail long ago to get back to that snappy feeling) my experience with SPAs is that they all add 10 megs of JavaScript up front and several dozen kbs of JSON or similar per click to save a couple tens of bytes per page of HTML. I pulled those numbers out of the air obviously, but I'm not sure that they're even exaggerations…