Workbox

Workbox

developer.chrome.com

1

About this website

Workbox is a set of production-ready Service Worker libraries and build tools developed by the Google Chrome team for building Progressive Web Applications that work reliably offline, load instantly on repeat visits, and provide app-like experiences on the web. The libraries simplify the complex and error-prone aspects of Service Worker development by providing battle-tested modules for routing, caching strategies, background synchronization, and offline analytics. The routing module matches incoming fetch events against URL patterns, RegExp matchers, or custom callback functions, directing each request to the appropriate caching strategy. Built-in caching strategies include Cache First for static assets, Network First for freshness-critical content, Stale While Revalidate for background updates, Network Only for bypassing cache, and Cache Only for fully offline scenarios, with each strategy configurable through plugins for cache expiration, cacheable response validation, and broadcast update notifications. The Precache module handles build-time asset injection, computing revision hashes for each file and managing intelligent cache cleanup of stale versions to avoid quota issues. Runtime caching supports cross-origin resources, Range requests for audio and video streaming, and background sync queues that persist failed requests and replay them when connectivity returns. The workbox-window module bridges the Service Worker thread with the main page thread for lifecycle event handling and update notifications. Build integrations include Workbox CLI, webpack GenerateSW and InjectManifest plugins, and Vite PWA plugin support. Navigation preload support accelerates multi-page applications by combining network and cache responses through streaming. Copyright 2018-2026 Google LLC.

Tags & Categories

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!