Last active
January 27, 2019 18:08
-
-
Save MrPeker/e1ba598b455358d2b73dd887d046a64a to your computer and use it in GitHub Desktop.
Cache Images Workbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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