diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index 91be9372..656ced40 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -25,7 +25,21 @@ export default defineNuxtConfig({ pwa: { workbox: { navigateFallbackDenylist: [/^\/api/], + cleanupOutdatedCaches: true, + runtimeCaching: [ + { + urlPattern: /^\/api/, + handler: "NetworkFirst", + method: "GET", + options: { + cacheName: "api-cache", + cacheableResponse: { statuses: [0, 200] }, + expiration: { maxAgeSeconds: 60 * 60 * 24 }, + }, + }, + ], }, + registerType: "autoUpdate", injectRegister: "script", injectManifest: { swSrc: "sw.js",