What is service worker ?

Service worker help your user to still browse your website when user suddenly get disconnected because of no network. Service worker technology help developer to enable Rich offline experience in today’s era.

From Microsoft Edge (It’s in preview) to Chrome it’s have a support for Service worker, Safari version 46 start supporting Service worker. It’s kind of technology that doesn’t break Service worker if browser doesn’t support it, so it’s good part of Service worker.

How Service Worker Works ?

When user visit the website, Through JavaScript code we register a service worker. Here is a great article for register a service worker https://developers.google.com/web/fundamentals/primers/service-workers/registration

In the service worker JavaScript file we define what things we want browser to cache.

How to test things in Service Worker ?

In chrome dev tool when you go to Application tab, you see that it’s have service worker in left pane, you can play with these things to test your service worker.¬† For debugging Service worker, Here is a nice article¬†https://developers.google.com/web/fundamentals/codelabs/debugging-service-workers/

If you interested to learning from Scratch, There is good free course on Udacity which can help you learnng Service Worker in Details from scratch.

Leave a Reply

Your email address will not be published. Required fields are marked *