Code splitting is a well-known technique we can use to divide our application’s JavaScript bundle into smaller bundles. To ensure fast navigations by preloading route bundles, we need to take a further step after code splitting. We don’t have to wait until the user visits a route to load its bundle.
Table of contents
Problems With Lazy LoadingPreload Route BundlesHow Does Preloading JavaScript Bundles Work in Angular?The PreloadingStrategy ClassRegister the Preloading StrategyWhat Strategy Should We Use?Preload All ModulesCustom StrategyDemo 🐳Route data PropertyNetwork Information API ℹ️Speculative PreloadingData-Driven Prefetching (Guess.js)Conclusion1 Comment
Sort: