🔧 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, cleanupOutdatedCaches: true,
clientsClaim: true, clientsClaim: true,
navigateFallback: '/index.html', navigateFallback: '/index.html',
navigateFallbackDenylist: [/^\/api/, /^\/healthz/], navigateFallbackDenylist: [/^\/api/, /^\/_/, /^\/healthz/]
runtimeCaching: [
{
urlPattern: /^\/api\//,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
networkTimeoutSeconds: 5,
cacheableResponse: { statuses: [0, 200] }
}
}
]
}, },
devOptions: { devOptions: {
enabled: true, enabled: true,
@@ -59,13 +48,14 @@ export default defineConfig({
], ],
server: { server: {
proxy: { proxy: {
'/api': 'http://localhost:8080', '/api': { target: 'http://127.0.0.1:8080', changeOrigin: true },
'/healthz': 'http://localhost:8080' '/_': { target: 'http://127.0.0.1:8080', changeOrigin: true }
} }
}, },
test: { test: {
environment: 'jsdom', environment: 'jsdom',
globals: true, globals: true,
include: ['src/**/*.test.ts'] include: ['src/**/*.test.ts'],
setupFiles: ['./src/lib/test-setup.ts']
} }
}); });