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

Workbox Broadcast Cache Update usage #37

Closed
zehua99 opened this issue Mar 2, 2018 · 6 comments
Closed

Workbox Broadcast Cache Update usage #37

zehua99 opened this issue Mar 2, 2018 · 6 comments

Comments

@zehua99
Copy link

zehua99 commented Mar 2, 2018

Hi! I want to notify my clients to upgrade their application when the website is updated. I noticed that there is a Workbox module called Workbox Broadcast Cache Update. Is there any standard way to use it on Nuxt pwa?

This question is available on Nuxt.js community (#c26)
@msgeissler
Copy link

I would like to know the same. Even overriding the default runtime caching routes does not work, as you cannot add the plugin as a strategy option.
It throws a ReferenceError: workbox is not defined or ReferenceError: self is not defined when I require workbox-sw inside nuxt.config.js.

Is there actually a solution for using a plugin in a strategy option?

@creazy231
Copy link

I would like to know the same. Currently I try to implement a workaround by calling a version number from a file and compare it to a version number in the local storage.

@fatlinesofcode
Copy link

👍 for more info on this

@creazy231
Copy link

Well, some weeks ago a found a solution to inform my clients to update the application by clicking on a button but my solution wasn't as easy as I could explain it to someone else.

All in all I found out, that the PWA uses workbox-sw to manage updates. It takes some time (some hours) and the sw recognize, that there is an other version number of the nuxt files and reloads the page on its own. That means that your users won't get your updates imminently but after some hours everyone should have the update.

Hope that helps. Took me several hours to find that out.

@MrJmpl3
Copy link

MrJmpl3 commented Dec 19, 2018

More information please, or example code

@pi0
Copy link
Member

pi0 commented Feb 7, 2019

You can use cachingExtensions to enable the plugin. Similar comment #64 (comment).

@pi0 pi0 closed this as completed Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants