Multiple Service Worker in few devices

9 views
Skip to first unread message

SHARAD SAXENA

unread,
Feb 16, 2018, 2:47:34 AM2/16/18
to service-worker-discuss

This is my Service Worker install Event with skipWaiting(), So on every refresh new Service Worker should be active and old one should Die, Which is happening for almost all devices except few Midevices.

I know putting skipWaiting() in the Service Worker file is not the best practice. BUt why it is happening for only few devices and not all?

    self.addEventListener('install', function (event) {
    self.skipWaiting();
    if(event) {
      event.waitUntil(
        caches.open(CACHE_NAME)
          .then(function (cache) {
            return cache.addAll(urlsToCache);
          })
      );
    }
  })
Reply all
Reply to author
Forward
0 new messages