diff --git a/.gitignore b/.gitignore index 1cf0b36..4a02aa1 100644 --- a/.gitignore +++ b/.gitignore @@ -152,6 +152,16 @@ __pycache__/ *.py[cod] *$py.class +# PWA generated files (regenerated on each build by next-pwa) +public/sw.js +public/sw.js.map +public/workbox-*.js +public/workbox-*.js.map +public/swe-worker-*.js +public/swe-worker-*.js.map +public/fallback-*.js +public/fallback-*.js.map + # Local Storage Uploads public/uploads/ diff --git a/next.config.js b/next.config.js index 9099870..497f845 100644 --- a/next.config.js +++ b/next.config.js @@ -1,8 +1,8 @@ const withPWA = require('@ducanh2912/next-pwa').default({ dest: 'public', - cacheOnFrontEndNav: true, - aggressiveFrontEndNavCaching: true, + cacheOnFrontEndNav: false, + aggressiveFrontEndNavCaching: false, reloadOnOnline: true, swcMinify: true, disable: process.env.NODE_ENV === 'development', @@ -15,6 +15,7 @@ const withPWA = require('@ducanh2912/next-pwa').default({ disableDevLogs: true, skipWaiting: true, clientsClaim: true, + cleanupOutdatedCaches: true, runtimeCaching: [ { urlPattern: /^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i, @@ -51,7 +52,7 @@ const withPWA = require('@ducanh2912/next-pwa').default({ }, { urlPattern: /\/_next\/static.+\.js$/i, - handler: 'CacheFirst', + handler: 'StaleWhileRevalidate', options: { cacheName: 'next-static-js', expiration: {