|
|
|
|
|
by phponpcp
2576 days ago
|
|
It's all about the use case. If you're on an ecommerce website and click between category and PDP pages 5-10 times browsing, a SPA is going to make that transaction an order of magnitude faster. Since you're only loading the smallest possible payload (JSON) that contains only the things that have changed, it is optimized in a way that is never going to be achievable with server-side rendering. At least that's why I opted to push for a SPA. |
|
First, because the largest ecommerce websites are not SPAs and are generating a shit ton of revenue. Not only Amazon and Ebay but also stuff like Magento and Shopify.
Second, while it can be argued that after a number of clicks the total kbs will be lower by using JSON and rendering on the client, the vast majority of users really care about the initial load. Much like monthly payments, it's generally better to have a consistent 500ms lag than a 3000ms lag on the initial load and then 200ms on every click. Of course I made these numbers to explain my point.
This does not apply to all use cases obviously. In some cases such as an application like Gmail an SPA is completely justified and my arguments do not hold, but in the case of e-commerce I think there are no valid arguments for an SPA.