Fix custom runtimeCaching rules, default runtimeCaching rule order (#3685)
Co-authored-by: Muaz Ahmad <mahmad2000@protonmail.com>
This commit is contained in:
parent
aa4a3024d9
commit
1a5e7cb113
@ -8,19 +8,22 @@ const runtimeCaching = require('next-pwa/cache');
|
||||
const withPWA = require('next-pwa')({
|
||||
dest: 'public',
|
||||
runtimeCaching: [
|
||||
...runtimeCaching,
|
||||
{
|
||||
urlPattern: /\.(?:ts|m3u8)$/i,
|
||||
handler: 'NetworkOnly',
|
||||
},
|
||||
{
|
||||
urlPattern: /^\/admin\/.*$/,
|
||||
urlPattern: (url) => { return url.pathname.startsWith("/admin/"); },
|
||||
handler: 'NetworkOnly',
|
||||
options: {
|
||||
fetchOptions: { credentials: 'same-origin' }
|
||||
}
|
||||
},
|
||||
{
|
||||
urlPattern: /^\/api\/.*$/,
|
||||
urlPattern: (url) => { return url.pathname.startsWith("/api/"); },
|
||||
handler: 'NetworkOnly',
|
||||
},
|
||||
...runtimeCaching,
|
||||
],
|
||||
register: true,
|
||||
skipWaiting: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user