workbox-window method to trigger SW update check
See original GitHub issueLibrary Affected: workbox-sw, workbox-window
Browser & Platform: all browsers
Issue or Feature Request Description: If I try to instantiate workbox a second time no events are fired. What I basically want to achieve is that the user presses a button, the service worker should reload and thus he will check for updates. It seems that currently the service worker can only be instantiated once. Appending a random timestamp in the file name causes the service worker to always download everything again.
There should be a method that just checks for updates of the service worker itself.
const workbox = new Workbox(`/service-worker.js`, {
scope: '/',
})
await workbox.register()
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (12 by maintainers)
Top Results From Across the Web
Handling service worker updates with immediacy
It registers a service worker using workbox-window , and will react if the service worker gets stuck in the waiting phase. When a...
Read more >Workbox 4: Implementing refresh-to-update-version flow using ...
This method takes care of all the complexity of precaching, version maintaining, fetching updated resources, updating the cache etc. We just ...
Read more >Inconsistent behaviour with workbox-window.update()
I am using the workbox-window update() method to trigger a service worker update check as described in workbox issue #2130. This question also ......
Read more >Broadcast updates to pages with service workers - web.dev
The Workbox package workbox-broadcast-update provides a standard way of notifying window clients that a cached response has been updated. This ...
Read more >11 Service Worker Registration | Workbox Window | React PWA
#11 Service Worker Registration | Workbox Window | Cache update on application re-deploy | React PWA · Key moments. View all · Key...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would be really useful, from a UX point of view, if this new
update()
method could return, somehow, a flag indicating if an update was found or not. If this update check is initiated by the user, for instance by clicking a ‘Check for Updates’ button, this would allow them to be informed that ‘No updates were found’. Otherwise nothing seems to happen…I gave a first try and created a PR which introduces the new
update
method.By any chance can you tell me how you usually create examples to reproduce cases like these?