deanhume/pwa-update-available

Advantage of this approach over calling skipWaiting() after install

Opened this issue · 0 comments

What's the advantage of letting users opt into update the SW over forcing the update by calling skipWaiting() within the 'install' event?

e.g.

self.addEventListener('install', event => {
  skipWaiting(); // <--- this!
  event.waitUntil(
    caches.open(cacheName)
      .then(cache => cache.addAll([
        './dog.jpg'
      ]))
  );
});