Extending Workbox: Custom strategies and plugins
summary
Workbox v6 adds a strategy base class you can extend to implement concrete behaviors like inflight request dedupe that collapses simultaneous fetches into one response and saves bandwidth, or a race cache and network strategy that checks both in parallel. Strategies use a StrategyHandler with methods like fetch and cachePut so plugins trigger lifecycle hooks such as fetchDidSucceed and handlerDidError; an example plugin returns a cached backup when a response isn’t 200. Strategies and plugins work with Workbox routing and can be published to npm.
AI-written summary · about
chapters (4)
- 0:00Introduction to Workbox
- 1:33Custom caching strategies
- 5:27Developing Workbox plugins
- 7:17Choosing an approach
related talks
51mAutomating a service worker with Workbox 6
46mWriting Service Workers with Workbox
38mAutomating Service Workers with Workbox 6
17mHow to build a PWA and stay sane: Introduction to Workbox
38mSending your Angular App into deep, deep offline with Workbox
47mSending the Angular app into deep, deep offline with Workbox
36mCaching strategies and their performance footprint
09mAdvanced PWA patterns
