🔧 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,
|
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']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user