Avoid precaching newer contents for old revisions
Brought to you by:
tomkozak
Originally created by: soc221b
Library Affected:
workbox-sw
Browser & Platform:
Google Chrome 120.0.6099.129
Issue or Feature Request Description:
During deployment, clients can install a service worker and send requests to servers to precache assets.
At this point, the server responds with newer content, and the service worker should not store the content in CacheStorage as it is requesting content for an old revision.
Reproducible repository: https://github.com/iendeavor/workbox-issue-precaching
{url: 'public/a.js', 'revision': 'version-1.js'}public/a.js is changed now, new metadata is {url: 'public/a.js', 'revision': 'version-2.js'})