Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Use a no-op Service Worker in Development

Alex Jover MoralesAlex Jover Morales
5:36

Having to manually unregister the Service Worker and clean the cache after you finish testing a Service Worker is ok, but at some point you’d rather automate it.

ServiceWorkerRegistration.unregister() can only be used within a registration and it doesn’t clean the cache, making it useless for the case.

However, using a no-operation (no-op) service worker will override the already registered one and remove the cache, leaving it in a clean slate.

The lesson shows how to automated this by creating a no-op Service Worker to use on development.

You must be a Member to view code