Workbox
Explore how Workbox streamlines the development of Progressive Web Apps by simplifying service worker setup, routing, and caching strategies. Understand the core concepts of routes, caching modules, and debugging to build robust offline-capable web applications with granular control and ease.
Setup
Workbox is an open-source project from Google, and it is currently the most widely used tool to develop PWAs.
It consists of a set of libraries and Node modules to abstract the complexity of service workers and caching strategies. This allows us to focus on the application business logic without worrying about the underlying PWA details.
Workbox gives developers more robust and granular control compared to PWA Builder, but, on the other side, it also expects a minimum of JavaScript and service workers know-how from the developer.
Install via CDN
To get started, we first need to create a service worker to import the Workbox file workbox-sw.js.
The importScripts() method belongs to the ...