How to use it
- List the files your app needs to start (the app shell), one per line.
- Choose a strategy for each type of request. Not sure? Read caching strategies or use the strategy picker.
- Set the offline page and cache limits.
- Copy
sw.jsto the root of your site, and add the registration snippet to your pages. - Change the version string whenever you deploy, so browsers pick up the new worker.
The generated worker uses plain JavaScript with no libraries, handles navigation preload, cleans old caches, never touches non-GET requests, and waits for your page to confirm before activating an update. For large apps with hashed build files, consider Workbox or Serwist.