Re:Browsers are pretty good at loading pages
by nathan_long on Monday July 22, 2019 @06:38AM
(#20496751)
> I agree that JSON could lead to less data being transferred over the wire
I haven't benchmarked the difference, but I bet HTTP compression removes most of the difference
> but that assumes your client already has cached the megabytes of JavaScript needed for you SPA
A cache that will need to be busted every time you deploy new code. You do deploy often, right?
On the client parsing is fast, but the slow part is the browser laying out the page and fetching new resources - but that is going to be slow anyway, even if you do client side rendering. To make that fast you need do something more intelligent than just rendering a different React component, as well as prefetching resources in the background. But how many SPAs actually bother trying to do that?
I agree that SPAs have their place, and they have a lot of advantages over what we had before, but I just don't understand how it has seemingly become the default for any kind of web development - with such disregard for performance.