i need to "purge" or "invalidate" Workbox SW cache after every release.
that's what i plan to do (dummy version of course), but i haven't enough experience to understand if this is the correct approach:
importScripts(...);
const version = 1;
const workboxSW = new WorkboxSW();
workboxSW.router.registerRoute(/\.(?:png|gif|jpg|svg|json|js|css|woff|mp3)$/,
workbox.strategies.cacheFirst({
cacheName: 'static-cache-' + version
})
);
and increase version at every release :) should i purge every file form the previous versions? there are different approach for that?
tnx for the feedback