How to handle releases with the service worker

Guito
26
Guito
commented a month ago

First a bit of background. I have a nuxt application which connects to a rest API.

The problem I'm facing is that whenever the API changes, and I do a release of the nuxt application solving the API problems, when recurrent users join the website, they have an outdated version of the website because of the serviceworker caching and I get errors. I have read the service worker life cycle and I am reloading the page whenever the sw finds an update, but it's not fully working.

What's the correct way of holding this behavior?

1
Informations
Question โ€ข Unresolved
#c83 - Created a month ago