4 ms·
> No, the reason is that CSS and JavaScript has to be reinitialized and reapplied to the page again. Glad to see this mentioned. Hopefully legions of devs can
by shady-lady 8y ago
> No, the reason is that CSS and JavaScript has to be reinitialized and reapplied to the page again.
Glad to see this mentioned.
Hopefully legions of devs can least now UNDERSTAND why SPA can be faster & what makes it so.
- k__ 8y agoI don't understand what you are getting at.
- shady-lady 8y agoIn all the articles written about SPAs being faster, 99% of them miss the mark when it comes to the why - namely the above. I can't remember ever seeing one of the fundamental reasons explicitly being called out..leading to vast amounts of devs never truly grasping the why of 'why are SPAs faster'.
- k__ 8y agoAh. The article was about not doing a SPA, so I was confused. Yes, they found a way to extract the part that makes SPAs fast and applied it to their legacy code-base. My idea of SPAs performance gain was mainly that they didn't send HTML, but JSON, which I cosindered vastly smaller.
- strzibny 8y agoThe problem is that the first load can absolutely kill everything and having second request served faster won't help. (e.g. me opening GMail in Indonesia and never being able to load it) I dislike the general SPAs are faster "truth". They might, they might not and the initial load can be just too much. You can sure spend time to optimize SPA to perform well though. Btw Turbolinks tries to solve this "do not parse JS again" thing and it's where the speed comes from.