feat:#4 updated cache and workbox

This commit is contained in:
Elmar Kresse
2024-05-19 21:29:39 +02:00
parent 9a9b405910
commit 1c22c2c227
3 changed files with 19 additions and 2 deletions

View File

@@ -67,7 +67,21 @@ export default defineConfig({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,json,vue,txt,woff2}'],
cleanupOutdatedCaches: true
cleanupOutdatedCaches: true,
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'https-calls',
expiration: {
maxEntries: 150,
maxAgeSeconds: 30 * 12 * 60 * 60, // 1 month
},
networkTimeoutSeconds: 10, // fall back to cache if api does not response within 10 seconds
},
},
],
},
devOptions: {
enabled: true,