cache versioning

Putting a version in each cache's name, such as static-v2, so a new service worker fills a new cache and deletes old ones on activate.

In more detail

When the service worker's activate event runs, it lists all cache names and deletes the ones that do not match the current version. It prevents pages from mixing files from two releases and stops old caches filling the user's disk.

Related terms

Taught in

References