Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple tabs scenario #473

Open
pratikt-cuelogic opened this issue Jan 7, 2020 · 0 comments
Open

Multiple tabs scenario #473

pratikt-cuelogic opened this issue Jan 7, 2020 · 0 comments

Comments

@pratikt-cuelogic
Copy link

We are planning to show modal informing user that

There's new version of this website available, please reload your browser to see the latest version.

my configuration is

new OfflinePlugin({
        excludes: ['**/.*', '**/*.map', '**/*.jpg', '**/*.png', '**/*.gz', '**/google-fonts.*', '**/**/google-fonts.*'],
        updateStrategy: 'changed',
        responseStrategy: 'network-first', // default: cache-first
        autoUpdate: 1000 * 60 * 5, //check every 5 minute
        ServiceWorker: {
          events: true,
          navigateFallbackURL: '/',
        },
      }),

Seems it is working fine for normal usecase, however users can have multiple tabs open (for our application its most likely), based on this configuration it will display modal for tabs asking user to refresh. However

as per service worker's working - User need to close all tabs or fully close the browser to see the changes reflected. A page reload will not reflect the changes.

will it work by just refreshing all tabs? any better user experience we can have ?
as service worker is shared across multiple tabs, how can we utilise it better ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant