Skip to content

Instantly share code, notes, and snippets.

@MrPeker
Last active Jan 27, 2019
Embed
What would you like to do?
Cache Images Workbox
// Cache First stratejisiyle resimlerinizi önbellekleyin
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 Gün
}),
],
}),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment