Open Kuro091 opened 3 months ago
Check https://github.com/vite-pwa/sveltekit/issues/65#issuecomment-1734213190
For background sync you can use backgroundSync
entry, something like this (not tested):
runtimeCaching: [{
urlPattern: /\/api\/.*\/*.json/,
handler: 'NetworkFirst', // <== or NetworkOnly: if so update the options properly
method: 'POST',
options: {
cacheName: 'api-cache',
expiration: {
maxEntries: 5,
maxAgeSeconds: 60,
},
backgroundSync: {
name: 'api-queue',
options: {
maxRetentionTime: 60 * 60,
},
},
},
}]
https://developer.chrome.com/docs/workbox/using-plugins
Question is how do I translate this piece of code: https://github.com/GoogleChrome/workbox/issues/2599#issuecomment-900304969
into vite pwa config without having to assign a custom base service-worker
which involves having a statusPlugin inside NetworkOnly constructor ?