1
votes

Does the Angular CLI approach to progressive web apps include a way to cache preloaded or lazy loaded modules using a service worker (Progressive Web App) approach?

For example the Angular Router has a PreAllModules strategy, so just curios if this can be combined or is combined with service worker caching?

In other words configure the generated service worker to cache all resources preloaded with the PreAllModules strategy.

1

1 Answers

1
votes

Yes, I believe you can set up your ServiceWorker to lazy-load your modules in the background. The CLI provides tooling for this, see:

https://angular.io/guide/service-worker-getting-started

This article also provides a thorough explanation:

https://blog.angular-university.io/angular-service-worker/