3 ms·
The difference between having a bare-bones HTML page, versus a bloated one, could make a significant price difference. A well designed Single Page App should b
by onion2k 3y ago
The difference between having a bare-bones HTML page, versus a bloated one, could make a significant price difference.
A well designed Single Page App should be downloading a small-as-possible initial bundle with the page HTML and CSS, and then only downloading the data necessary for any given page. In theory that results in less bandwidth used if you're looking at a reasonably large number of pages compared to downloading a server rendered HTML page for each page because you only download the HTML once in the SPA version compared to every page you load with the SSR version. This is literally the reason why SPAs became popular in the first place.
In badly built apps this isn't the case - the data is bloated, the bundle isn't optimized, etc. I imagine in the case of Gmail this is the case though - you probably only need to read a couple of dozen moderately large emails before the JS version starts to win out. This is something you'd need to test rather than making an assumption though.
That said, a native app will win over both because it's already on your device so the bandwidth used is only the email data.
- sgt 3y agoWith continuous deployment, that cached SPA may frequently be replaced though. Depending on the team, but I've seen people deploying to production several times a week. That means a lot more JS and asset downloads as well.
- onion2k 3y agoThat's true but it can be mitigated by code-splitting to an extent. Making a vendor bundle out of any dependencies separately to your own code limits any app changes to a single part of the download unless you update a dependency version.