I use workbox generateSW method to generate service worker and this is the config I use :
const workbox = require("workbox-build");
workbox.generateSW({
globDirectory: "./",
globIgnores: ["node_modules/**", "**/generator.js", "**/sw.js"],
globPatterns: ["**/*.{css,js}"],
swDest: "./sw.js",
sourcemap: false,
cleanupOutdatedCaches: true,
clientsClaim: true,
runtimeCaching: [
{
urlPattern: /\.(?:html|htm|xml)$/,
handler: "StaleWhileRevalidate",
options: {
cacheName: "runtimecaching name",
expiration: {
maxAgeSeconds: 1,
},
},
},
],
});
I couldn't find an expiration time to delete the old cache in the docs , so How can I cleanup the cache after sometime with workbox-build generateSW ?