Open nikandlv opened 1 year ago
Here is my code
The issue is when i load the main page it caches every single resource i dont even in this page!
Reverting to next-pwa: 5.2.0 works
next-pwa
let withPWA = require('next-pwa')({ cacheOnFrontEndNav: false, register: true, skipWaiting: true, maximumFileSizeToCacheInBytes: 10485760, scope: '/', dest: 'public', sw: 'service-worker.js', runtimeCaching: [ { urlPattern: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i, handler: 'StaleWhileRevalidate', options: { cacheName: 'static-font-assets', expiration: { maxEntries: 4, maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days }, }, }, { urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i, handler: 'StaleWhileRevalidate', options: { cacheName: 'static-image-assets', expiration: { maxEntries: 64, maxAgeSeconds: 24 * 60 * 60, // 24 hours }, }, }, { urlPattern: /\.(?:css|less)$/i, handler: 'StaleWhileRevalidate', options: { cacheName: 'static-style-assets', expiration: { maxEntries: 16, maxAgeSeconds: 24 * 60 * 60, // 24 hours }, }, }, { urlPattern: /\.(?:json|xml|csv)$/i, handler: 'StaleWhileRevalidate', options: { cacheName: 'static-data-assets', expiration: { maxEntries: 16, maxAgeSeconds: 24 * 60 * 60, // 24 hours }, }, }, ], })
next
Steps to reproduce the behavior:
Only cache the resources on current page
Summary
Here is my code
The issue is when i load the main page it caches every single resource i dont even in this page!
Reverting to
next-pwa
: 5.2.0 worksVersions
next-pwa
: 5.6.0next
: 12.0.10How To Reproduce
Steps to reproduce the behavior:
Expected Behaviors
Only cache the resources on current page