Preloading modules
Lazy loading speeds up our application load time by splitting it into multiple bundles, and loading them on demand. We designed the router to make lazy loading transparent, so you can opt in and opt out of lazy loading with ease.
The issue with lazy loading, of course, is that when the user navigates to the lazy-loadable section of the application, the router will have to fetch the required modules from the server, which can take time.
To fix this problem we have added support for preloading. Now the router can preload lazy-loadable modules in the background while the user is interacting with our application.
This is how it works.
First, we load the initial bundle, which contains only the components we need to have to bootstrap our application. So it is as fast as it can be.
Then, we bootstrap the application using this small bundle.
At this point the application is running, so the user can start interacting with it. While she is doing it, we, in the background, preload other...