Offline and installed apps
Service workers that keep pages working offline, a web app manifest people can install, one caching strategy per request kind and safe worker updates.
- Recommended 4
- Optional 1
Recommended
Let people install the site
WEB-225Publish a web app manifest with a name, start address, colours, and 192 and 512 px icons, including a maskable one.
Give the installed app a fixed identity
WEB-264Set
idandscopein the web app manifest, and never changeidonce people have installed the app.Choose a caching strategy for each kind of request
WEB-266Give the service worker one written strategy per kind of request. Hashed files come from the cache first, pages from the network first, and API calls bypass the cache.
Ship new service workers without trapping old ones
WEB-267Keep the worker at one fixed address, serve it with
Cache-Control: no-cache, and keep a worker ready that removes itself.
Optional
Keep working when the network drops
WEB-224Add a service worker, a small script that sits between the page and the network. Show an offline page and cached pages when the network fails.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/offline-and-installed-apps">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.