Skip to content

Commit 6e843cf

Browse files
authored
🔀 Merge pull request #1902 from he0119/fix/pwa-runtimeCaching
fix(pwa): should always fetch conf.yml first
2 parents cbc93e7 + d7bd5a6 commit 6e843cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/utils/defaults.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,18 @@ module.exports = {
337337
/^manifest.*\.js$/, // default value
338338
/\.nojekyll$/,
339339
/\.gitignore$/,
340+
/conf\.yml$/, // ignore config for runtimeCaching
341+
],
342+
// https://developer.chrome.com/docs/workbox/modules/workbox-build#type-RuntimeCaching
343+
runtimeCaching: [
344+
{
345+
urlPattern: /conf\.yml$/,
346+
handler: 'NetworkFirst',
347+
options: {
348+
cacheName: 'config-cache',
349+
networkTimeoutSeconds: 3,
350+
},
351+
},
340352
],
341353
},
342354
},

0 commit comments

Comments
 (0)