Fix workbox cache matching and expiration

This commit is contained in:
schroda
2026-04-27 17:28:37 +02:00
parent 9440326b72
commit f36a204ed7
2 changed files with 25 additions and 0 deletions

View File

@@ -73,10 +73,16 @@ export default defineConfig(({ command }) => ({
maxAgeSeconds: d(1).days.inWholeSeconds,
maxEntries: 2500,
purgeOnQuotaError: true,
matchOptions: {
ignoreVary: true,
},
},
cacheableResponse: {
statuses: [0, 200],
},
matchOptions: {
ignoreVary: true,
},
},
},
{
@@ -93,10 +99,16 @@ export default defineConfig(({ command }) => ({
maxAgeSeconds: d(1).days.inWholeSeconds,
maxEntries: 5000,
purgeOnQuotaError: true,
matchOptions: {
ignoreVary: true,
},
},
cacheableResponse: {
statuses: [0, 200],
},
matchOptions: {
ignoreVary: true,
},
},
},
{
@@ -113,10 +125,16 @@ export default defineConfig(({ command }) => ({
maxAgeSeconds: d(365).days.inWholeSeconds,
maxEntries: 300,
purgeOnQuotaError: true,
matchOptions: {
ignoreVary: true,
},
},
cacheableResponse: {
statuses: [0, 200],
},
matchOptions: {
ignoreVary: true,
},
},
},
{
@@ -129,10 +147,16 @@ export default defineConfig(({ command }) => ({
maxAgeSeconds: d(4).days.inWholeSeconds,
maxEntries: 500,
purgeOnQuotaError: true,
matchOptions: {
ignoreVary: true,
},
},
cacheableResponse: {
statuses: [0, 200],
},
matchOptions: {
ignoreVary: true,
},
},
},
],