Service Worker caching an asp net core 2.0 application

1

I can not meet the specifications of progressive web apps because my service worker does not cache the web app.

Follow the code:

self.addEventListener('install', e => {
  let timeStamp = Date.now();
  e.waitUntil(
    caches.open('dashboardetica.azurewebsites.net').then(cache => {
      return cache.addAll([
        '.',
        '/',
        './',
        '/Home/'
      ])
      .then(() => self.skipWaiting());
    })
  )
});

self.addEventListener('activate',  event => {
  event.waitUntil(self.clients.claim());
});

self.addEventListener('fetch', event => {
    event.respondWith(
      caches.match(event.request, {ignoreSearch:true}).then(response => {
        return response || fetch(event.request);
      })
    );
});
    
asked by anonymous 12.10.2017 / 14:51

0 answers