You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: