# mdn/serviceworker-cookbook

It's online. It's offline. It's a Service Worker!

Repository: https://github.com/mdn/serviceworker-cookbook
Canonical: https://ross.abutalabs.com/products/serviceworker-cookbook
Language: JavaScript
License: MIT
License Family: permissive
Archived: true
Last push: 2022-11-01T15:06:45+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3998, "days_push": 1401, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2892, forks 329 (observed 2026-08-28T04:07:28.497656+00:00)

## What it is
A collection of dozens of practical, working Service Worker recipes from Mozilla covering offline experiences, caching strategies, push notifications, and background sync. It serves as a learning resource for web developers from beginner to expert.

## Use cases
- learn how to build offline-first web apps with service workers
- find example code for caching strategies in the browser
- implement push notifications on the web
- understand background sync in service workers
- make my website faster with service worker caching
- get started with the Service Worker API

## When to choose
- you want runnable, annotated examples of Service Worker, Cache, Push, or Background Sync APIs
- you are learning offline-first web development from scratch
- you need reference recipes for common service worker patterns

## When to avoid
- you need a production-ready service worker library with tooling like Workbox
- you need a maintained framework rather than example code
- you need support for non-browser environments

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: caching, http-client, developer-tools
- domain: web-development, frontend, tutorials, documentation
- platform: browser
- tags: service-worker, offline-first, progressive-web-apps, push-notifications, background-sync, cache-api, examples, cookbook, javascript, nodejs

## Member repositories
- mdn/serviceworker-cookbook (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:28.497656+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:48:16.650943+00:00, confidence not recorded.
  - readme: https://github.com/mdn/serviceworker-cookbook (fetched 2026-08-28T04:07:28.497656+00:00, sha b45f62153699)
- Data as of 2026-08-30T08:39:29.467469+00:00.
