From the course: Building a Resilient Web

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Service workers add reliability

Service workers add reliability

From the course: Building a Resilient Web

Service workers add reliability

- [Narrator] A regular website or app relies on a persistent connection with the host to be able to bring up new content and add interactivity. It relies on the browser being online and the host being online. We can make that user experience a lot more resilient by introducing a service worker into that transaction. A service worker is a JavaScript file that once downloaded runs separately and on its own in the browser. It can do a lot of server-like things like send and receive requests, cache resources and then retrieve those cached resources, intercept requests, deliver push messages, et cetera, et cetera. The thing about service workers is they are progressive enhancement by default. They rely on JavaScript to work and they are extensions to the existing experience rather than a requirement. In other words, a website will work with or without the service worker. The service worker adds features to the website…

Contents