tech/webdev magazine

August 19, 2024

Optimizing SPA load times with async chunks preloading

Monday, August 19, 2024 Teklinks

Hello hello! In this post, I’ll explain how to improve the performance of client-side rendered apps by avoiding the waterfall effect caused by route-based lazy-loading. We'll do this by injecting a custom script that preloads the chunks for the current route, ensuring they’re downloaded in parallel with the entry point chunk. I'll use Rsbuild for the script injection, but its code can easily be adapted for Webpack and other bundlers as well.

Full article