workbox icon indicating copy to clipboard operation
workbox copied to clipboard

Is there the workbox-background-sync can update the ui?

Open kaiwenxiao opened this issue 1 year ago • 0 comments

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

kaiwenxiao avatar Jul 27 '22 08:07 kaiwenxiao