4 ms·
Sure. We are a B2C company. We have multiple customer flows to place orders on our website. Majority of our users use mobile phones to place orders. Thus, perf
by BIackSwan 9y ago
Sure. We are a B2C company. We have multiple customer flows to place orders on our website.
Majority of our users use mobile phones to place orders. Thus, performance of our webapp on mobile is critical.
Our users have slow 3G connections to access it. And we ran experiment to speed up one of flows to use route based chunking/code splitting.
We got a 10x improvement. The uncached gzipped page load speed went from ~30s to ~3s on a 3G connection. We used chrome's throttling (both network and CPU) feature to test and build the app.
We had to modify our user flow a bit to allow render the first page super fast, but it was well worth the tradeoff. The biggest reason of the speed up was just the smaller initial bundle size (the first chunk only contained react and react-dom plus the first component to render) and the fact that the render only needed that to get started with the first paint.
There is still the problem that the other chunks are not loaded until the subsequent components are actually asked to be rendered - so now we are working on a way to asynchronously preload the other chunks in the background while the user is interacting with the first component, thus making the subsequent interactions super fast. Still a WIP though.
- pspeter3 9y agoSounds great and inline with our thoughts. I'd love to see a blog post with more detail when it works!