🔧 Stop caching API responses in the service worker

This commit is contained in:
2026-11-29 20:16:45 +00:00
parent d9890db12f
commit 98f3e8048c
2 changed files with 6 additions and 15 deletions
+1
View File
@@ -0,0 +1 @@
import 'fake-indexeddb/auto';
+5 -15
View File
@@ -25,18 +25,7 @@ export default defineConfig({
cleanupOutdatedCaches: true,
clientsClaim: true,
navigateFallback: '/index.html',
navigateFallbackDenylist: [/^\/api/, /^\/healthz/],
runtimeCaching: [
{
urlPattern: /^\/api\//,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
networkTimeoutSeconds: 5,
cacheableResponse: { statuses: [0, 200] }
}
}
]
navigateFallbackDenylist: [/^\/api/, /^\/_/, /^\/healthz/]
},
devOptions: {
enabled: true,
@@ -59,13 +48,14 @@ export default defineConfig({
],
server: {
proxy: {
'/api': 'http://localhost:8080',
'/healthz': 'http://localhost:8080'
'/api': { target: 'http://127.0.0.1:8080', changeOrigin: true },
'/_': { target: 'http://127.0.0.1:8080', changeOrigin: true }
}
},
test: {
environment: 'jsdom',
globals: true,
include: ['src/**/*.test.ts']
include: ['src/**/*.test.ts'],
setupFiles: ['./src/lib/test-setup.ts']
}
});