4 ms·
Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Once a SPA is loaded you can send tiny cr
by supermw 8y ago
Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app?
Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR.
- shusson 8y ago> Why do people insist on comparing the initial frontload of a SPA to the page load of every page in their SSR web app? Because a user doesn't care if it's the initial frontload or not.
- est31 8y ago> Once a SPA is loaded you can send tiny crumbs of data faster than any significant SSR. You can, but often that's not what's happening. E.g. crates.io is currently built as an SPA. It is first receiving a HTML page that loads a javscript file, that performs an XHR request (actually, multiple) that answers with JSON that is used to create the final DOM of the page. The Javascript file is cached but that's about it, it still involves one additional needless roundtrip for the website. The JSON sent is so badly designed that it alone is far more than the final DOM of the page. Jus check out this: https://crates.io/crates/winapi https://crates.io/crates/winapi vs this: https://crates.rs/crates/winapi https://crates.rs/crates/winapi Only the XHR requests for the crates.io page take up 99 KB uncompressed, while the entire crates.rs winapi page takes 103 KB uncompressed.
- ishi 8y agoOnce it's loaded. But not all users have a fast Internet connection, even in the USA. So I'm not sure you can expect them to wait for your 1MB javascript bundle to load.
- dictum 8y agoUntil you open some link in the app in a new tab, and a whole new ship must be built before it sets sail.
- shusson 8y agoUsually(hopefully) the initial bundle is cached, so network shouldn't be a problem... still have to initialise the SPA though.
- seba_dos1 8y ago...which still can take significant amounts of CPU and RAM, especially on busy and underpowered hardware that webdevs don't tend to test their apps on.