fix: nginx proxy URI, SW cache noms uniques, sw.js no-cache

This commit is contained in:
Claude
2026-05-01 07:51:13 +02:00
parent 5de20a2fcf
commit 6741f9fa75
2 changed files with 24 additions and 7 deletions
+6 -4
View File
@@ -26,13 +26,15 @@ export default defineConfig({
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
cleanupOutdatedCaches: true,
runtimeCaching: [
{
// Cache API responses (stale-while-revalidate pour les listes)
// Network-first pour les listes (évite de servir un cache vide)
urlPattern: /^\/api\/(?:companies|categories)/,
handler: 'StaleWhileRevalidate',
handler: 'NetworkFirst',
options: {
cacheName: 'api-static',
cacheName: 'notesfrais-api-static',
networkTimeoutSeconds: 8,
expiration: { maxEntries: 20, maxAgeSeconds: 60 * 60 },
},
},
@@ -41,7 +43,7 @@ export default defineConfig({
urlPattern: /^\/api\/invoices/,
handler: 'NetworkFirst',
options: {
cacheName: 'api-invoices',
cacheName: 'notesfrais-api-invoices',
networkTimeoutSeconds: 8,
expiration: { maxEntries: 100, maxAgeSeconds: 24 * 60 * 60 },
},