From the course: JavaScript: Service Workers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Abilities

Abilities - JavaScript Tutorial

From the course: JavaScript: Service Workers

Start my 1-month free trial

Abilities

- [Instructor] A service worker has abilities on the scope. So it's like a couple of super powers that just keep file path on top of our website. The most important ability is to see all the network requests that pages in the scope are requesting, even across domain, which means every website from our domain that is requesting images, css files, (mumbles) files, will go through the service worker. But seeing requests is not the only ability. Responding for those requests is even more important. The service worker can create a response and take that response from a cache or it can go to the network. But the service worker will be there in the middle, like a proxy, seeing and responding and being responsible for those responses. Also, the service worker can create responses on the fly, without going to any server or without going to any cache. Just creating a response like if it is web server. On some platforms, the service worker can also receive messages from the server, even if the…

Contents