angular / mobile-toolkit

Tools for building progressive web apps with Angular
MIT License
1.34k stars 175 forks source link

Cache management forbids to host several PWAs each in its subfolder on the same domain #162

Open VincentJousse opened 7 years ago

VincentJousse commented 7 years ago

On a given domain, I need to host several PWAs. I created a folder for each and each one works perfectly if it is the only one installed on the current browser. Each installation of a new PWAs resets all the cache, making the first apps unusable.

The offline-plugin project solved this by adding a cacheName setting.

It is a huge limitation to allow only one PWA per origin.

BorntraegerMarc commented 7 years ago

You can add scopes for service workers. This should enable you to have multiple service workers for one domain

VincentJousse commented 7 years ago

Have you a link to some documentation or explanations ?

BorntraegerMarc commented 7 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers

VincentJousse commented 7 years ago

The scopes are abstracted by the mobile-toolkit library, right ? How can I tweak this using the angular service worker ?