From the course: JavaScript: Service Workers
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Unregister the service worker - JavaScript Tutorial
From the course: JavaScript: Service Workers
Unregister the service worker
- [Instructor] Back to our code in video 10 of chapter two, it's time to talk about unregistering service worker. On most of the browser, your service worker will leave and be activated mostly forever. So it's not going to disappear automatically. Safari is the only browser that, right now, might delete and unregister your service worker after a few weeks of inactivity. So if the user is not going back to your website, Safari might delete your service worker. But let's say that, in the future, maybe in a year, you don't want the service worker anymore in your current scope. Probably you are thinking, well, let's delete the file. So let's take the service worker in the server and delete the file. And then, when the browser is doing the check algorithm, it will verify that there is no service worker in the server, and will delete the service worker registration in the client. Well, that's not how it works. If you delete the file in the server, the client will never unregister the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Register a service worker4m 22s
-
Change the default scope3m 53s
-
Handle service worker events2m 50s
-
Debug with Developer Tools in Chrome5m 51s
-
Debug with other browsers3m 18s
-
Load external files3m 6s
-
Work with the registration5m 52s
-
Update the service worker5m 36s
-
Manage updates in your code4m 24s
-
Unregister the service worker3m 22s
-
-
-
-
-
-