fix: nginx proxy URI, SW cache noms uniques, sw.js no-cache
This commit is contained in:
@@ -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 },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user