When generating the md5 hash for the manifest version include a timestamp.
var name = `${allFiles.length}-${totalSize}-${new Date().getTime()}`;
Why?
Minor CSS changes don't always register as actual changes. For example, changing the padding of an element from 1rem to 2rem returns the same total size so the service worker doesn't know that the cache needs to be cleared. The downside to adding a timestamp is that every deployment will trigger a full cache clear when using an automated deployment pipeline.
When generating the md5 hash for the manifest version include a timestamp.
Why?
Minor CSS changes don't always register as actual changes. For example, changing the padding of an element from
1rem
to2rem
returns the same total size so the service worker doesn't know that the cache needs to be cleared. The downside to adding a timestamp is that every deployment will trigger a full cache clear when using an automated deployment pipeline.