workbox
workbox copied to clipboard
Is there the workbox-background-sync can update the ui?
For my case, I'm using GenerateSW
mode for workbox-background-sync
which my webpack.config.js look like this:
workboxPluginMode: 'GenerateSW',
workboxOptions: {
cacheId: 'pwa-sample',
swDest: 'service-worker.js',
clientsClaim: true,
skipWaiting: true,
runtimeCaching: [
{
urlPattern: new RegExp('^http://localhost:5000/'),
// handler: 'StaleWhileRevalidate',
handler: 'NetworkOnly',
options: {
cacheName: 'api',
expiration: {
maxAgeSeconds: 60 * 60 * 24
},
cacheableResponse: {
statuses: [200, 304]
},
fetchOptions: {
mode: 'cors',
},
matchOptions: {
ignoreSearch: true,
},
// broadcastUpdate: {
// // All values here are optional:
// channelName: 'my-test-channel',
// }
backgroundSync: {
name: 'my-queue-name',
options: {
maxRetentionTime: 60 * 60,
},
}
}
}
]
}
}```
Thanks. I can get the re-request, but not UI updated