Exclude subsite urls while using sw precache in angular5
this should work:
staticFileGlobs: [ 'dist/index.html', 'dist/*.{js,css,ico}', 'dist/!(Subscription)/**/*.{js,html,css,png,jpg,gif,svg,eot,ttf,woff,ico}']
found here: https://github.com/GoogleChromeLabs/sw-precache/issues/97
after generating serviceworker,I checked whether the request contains "Subscription" in fetch event like below which is working fine
self.addEventListener('fetch', function(event) {if (event.request.method === 'GET') {// Should we call event.respondWith() inside this fetch event handler?// This needs to be determined synchronously, which will give other fetch// handlers a chance to handle the request if need be.var shouldRespond;if (event.request.url.match('^.*(\/Subscription\/).*$')) { return false;} // ORif (event.request.url.indexOf('/Subscription/') !== -1) { return false;} .............}})
Its working fine.