My website offers an array of web apps for each client. Each client has a different mix of apps that can be used.
Each web app is a hosted in a different folder.
So I need to cache for each client only it's allowed web apps instead of caching all the apps, many of them he the user, will not use at all.
I naively created a global service worker for the shell of the website and custom named service worker for each folder or app.
However I noticed that after the first service worker, say sw_global.js service worker registers, installs, activates, fetches succesfully and creates a cache named cache-global, the second service worker, say sw_app1,js, which creates it's own cache cache-app1, clears all cache-global.
How can I use custom service worker for each folder?. Please keep in mind that each folder is a microservice or a web app which is not necesarilly allowed for all users, so it's imperative to not cache all content from a unique service worker.
Actually I code on vanilla.js, no angular, no react, no vue, no nada.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…