Skip to content

Commit

Permalink
Use purgeOnQuotaError
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick committed Jun 22, 2018
1 parent f71008c commit 17f5bae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/service-worker.mjs
Expand Up @@ -97,7 +97,10 @@ workbox.routing.registerRoute(
workbox.strategies.cacheFirst({
cacheName: 'profile-images',
plugins: [
new workbox.expiration.Plugin({maxEntries: 50}),
new workbox.expiration.Plugin({
maxEntries: 50,
purgeOnQuotaError: true,
}),
],
})
);
Expand All @@ -108,7 +111,10 @@ workbox.routing.registerRoute(
cacheName: 'other-images',
plugins: [
new workbox.cacheableResponse.Plugin({statuses: [0, 200]}),
new workbox.expiration.Plugin({maxEntries: 5}),
new workbox.expiration.Plugin({
maxEntries: 10,
purgeOnQuotaError: true,
}),
],
})
);
Expand Down

0 comments on commit 17f5bae

Please sign in to comment.