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.

What we can do

What we can do - JavaScript Tutorial

From the course: JavaScript: Service Workers

Start my 1-month free trial

What we can do

What can we do with a service worker? If we are creating a Progressive Web App, or a PWA, a service worker is mandatory. A service worker is like the brain of a Progressive Web App. So if we want to create these kind of apps we need to create a service worker. In this case the service worker will be responsible for installing all of the apps assets such as CSS, JavaScript, SVG files, images, videos and web phones. And it's also going to be responsible for serving those files from a local cache. Maybe we don't want to create the Progressive Web App but we want to offer the user an offline experience. In that case, the service worker, will be responsible for that behavior. We can make the whole website available offline, or just part of the website. It's up to us. When we are dealing with web performance, the service worker is a key piece to increase the experience of the first look because the service worker can cache files and serve those files from the cache when the user is trying…

Contents