kevinmarrec / nuxt-pwa-module

⚠️ DEPRECATED ⚠️ Zero config PWA solution for Nuxt 3
MIT License
338 stars 32 forks source link

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

Open re2005 opened 1 year ago

re2005 commented 1 year ago

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!

kevinmarrec commented 1 year ago

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

re2005 commented 1 year ago

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

kevinmarrec commented 1 year ago

@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