0

I have a website implemented in PHP that also has a service worker, i.e. www.domain.com/sw.js registered.

My intention is to rewrite the site entirely with NodeJS and what to rewrite the service worker with another file name, i.e www.domain.com/service-worker.js.

My doubts are:

  • What happens if in the new implementation I stop serving the sw.js file? Does it makes the old service worker to be uninstalled and removed ? If not,
  • How can I unsinstall the old service worker sw.js from the new one service-worker.js?
acanimal
  • 4,800
  • 3
  • 32
  • 41

1 Answers1

1
  1. Remove sw.js
  2. Add service-worker.js
  3. Use this sample to unregister any and all previous Service Workers
  4. Register new SW at service-worker.js
pate
  • 4,937
  • 1
  • 19
  • 25