sw-precache-webpack-plugin remove old cache

1.5k Views Asked by At

I am using create-react-app that includes sw-precache-webpack-plugin i also config cacheId in webpack.config.prod, i noticed webpack generate news files and filenames after every build and all are stored in the same cache but the old files also continues in cache ¿what is the way to remove all not necesary files of sw cache?

1

There are 1 best solutions below

1
On

As of this moment sw-precache-webpack-plugin and sw-precache (which is used behind the scenes) don't seem to offer deleting old cache entries as per their documentation.

You can easily do it by hand if you change the cache name every time you make a new build. More on that here.