Service Worker caching an Asp net core 2.0 application

Asked

Viewed 82 times

1

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

inserir a descrição da imagem aqui

Follows 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);
      })
    );
});
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.