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

After removing redux-offline, how do we ensure that client's who have old versions get the latest update? #494

Open
ch-tactica opened this issue Feb 10, 2021 · 0 comments

Comments

@ch-tactica
Copy link

ch-tactica commented Feb 10, 2021

Encountering a lot of cache-related issues with Offline-plugin, some of which I was able to address with better utilization of service worker events. But ultimately, we decided to remove offline-plugin from our project, as it was not necessary.

However, user's who have service-worker related configuration issues are still getting old, cached versions of the website. In some cases, a version as old as three months ago. We have our cache-control headers in place in htaccess for sw.js, and index.html, we've fully removed offline-plugin from the project, and are using webpack-remove-serviceworker-plugin to uninstall the service-workers. This works great for user's who have a working version of the service worker, but there are many who don't.

We've even added script tags directly to index.html to de-register service workers as early as possible, but it seems not even the latest index.html is being fetched, it just serves index.html from the offline cache, even if the user is online and a latest service worker is available. I've asked users to try rebooting / opening a fresh instance of chrome, but still hit this issue.

How can these users get an updated version of the site without having to manually unregister the service workers or doing a hard-refresh? Hard refresh seems to consistently resolve the issue in many cases, but we can't realistically expect all of our users to do so. Navigating directly to sw.js in the browser also seems to resolve the issue.

The user's who are experiencing these issues, all see to hit this error in their console:

Uncaught (in promise) TypeError: Failed to update a ServiceWorker for scope (‘https://example.net/’) with script (‘https://example.net/sw.js’): The script resource is behind a redirect, which is disallowed.

Sadly, when I've looked for this issue on Google, every instance is with somebody who is doing an http -> https redirect, or www -> non-www redirect. Neither of which apply in my case.

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