nuxt-pwa-module icon indicating copy to clipboard operation
nuxt-pwa-module copied to clipboard

Do you have features like `auto update` or at least some api to detect when the page needs refresh.

Open re2005 opened this issue 3 years ago • 3 comments

I use vite-plugin-pwa in other projects and they provide a way to detect when the page needs an update.

How can we do the same with this plugin?

Thanks!

re2005 avatar Oct 22 '22 16:10 re2005

Hi @re2005 , it requires you to use custom Service Worker template, you have a little notice about the option here : https://github.com/kevinmarrec/nuxt-pwa-module#configuration

kevinmarrec avatar Nov 07 '22 13:11 kevinmarrec

Hey @kevinmarrec thanks.

But is not a clear path on how to easily implement the same very useful features that vite-plugin-pwa provides.

If you could indicate here, on how to detect when the page needs an update and also how to trigger the workbox to unregister the worker and refresh, invalidating the old cache, would be really amazing.

Thanks

re2005 avatar Nov 09 '22 09:11 re2005

@re2005

For the short answer it's mainly about Workbox knowledge which should be found in their respective documentation, but the objective is to have a clear path as you asked.

We have a plan at Nuxt team to make this module official with an up to date documentation. I'll try to have instructions about how to achieve what you mentioned here.

And

kevinmarrec avatar Dec 19 '22 12:12 kevinmarrec