🔧 Stop caching API responses in the service worker
This commit is contained in:
@@ -0,0 +1 @@
|
||||
import 'fake-indexeddb/auto';
|
||||
+5
-15
@@ -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']
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user