Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created November 19, 2018 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/1e2115984d2c6bbe1b7b05c0bcf4f264 to your computer and use it in GitHub Desktop.
Save goofmint/1e2115984d2c6bbe1b7b05c0bcf4f264 to your computer and use it in GitHub Desktop.
workbox.routing.registerRoute(/\.(?:png|gif|jpg|jpeg|svg)$/,
workbox.strategies.cacheFirst({
cacheName: 'images',
plugins: [
new workbox.expiration.Plugin({
maxEntries: 60,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days
}),
],
}),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment