4 ms·
There really is not. SPAs generally means tons more assets being loaded and hard errors on on unreliable connections. On a web page, missing a bit of the page
by masklinn 5y ago
There really is not. SPAs generally means tons more assets being loaded and hard errors on on unreliable connections.
On a web page, missing a bit of the page at the end is not an issue, you might have somewhat broken content but that's not a deal-breaker.
With an SPA, an incompletely loaded API call is just a complete waste of the transferred bytes.
And slow connections also tend to have much larger latencies. Care to guess what's an issue on an SPA which keeps firing API calls for every interaction?
> So your initial page load would be slow because of all the HTML and JS, but afterwards it should be faster compared to having server side rendered pages.
The actual effect is that the initial page load is so slow you just give up, and if you have not, afterwards it's completely unreliable.
Seriously, try browsing the "modern web" and SPAs with something like a 1024 DSL with 100ms latency and 5% packet loss, it's just hell. And it's the sort of connections you can absolutely find in rural places.
- RedShift1 5y agoWon't loading an entire HTML page be just as bad on such a connection? There's a lot more data to transfer.
- misnome 5y ago> On a web page, missing a bit of the page at the end is not an issue, you might have somewhat broken content but that's not a deal-breaker - the argument is that most of what you probably want is better than nothing. Although I can imagine sites thus prioritising ads even more…
- ratww 5y agoNot at all, unless there is an absurd amount of content on the page that is unrelated to the data being fetched (like title, footer, sidebar). An HTML-table, for example, is in the same ballpark size-wise as a JSON representation of the same data. And that's without taking into account the fact the JSON can potentially carry more information than necessary. Facebook is an example of a website where there is such an absurd amount of content that's not the focus of the page: the sidebars, the recommendations, the friend list of the chat, the trends, the ads. It sorta makes sense for them to have an SPA (although let's be frank: most people in slow connections prefer "mobile" or "static" versions of those sites). The impetus for SPAs was never really speed. The impetus for SPAs is control for developers, by allowing navigation between "pages" but with zero-reloads for certain widgets. It was like 90s HTML frames but with full control of how everything works.