Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lost control of PWA due to aggressive service worker

I was very cautious about adding a service worker to my PWA that would cache all my files. I tried to implement a system that would always call the server to get a "version" file so that when that "version" file updated, the cache would be cleared.

However, something didn't work correctly, and now the clients no longer call the server at all, since they have the files they need. This is perfect for offline use! But those clients will never call the server again so when I update the site to fix the problem (which I have done), they do not get the update!

Any suggestions on how I can connect with those clients again?

like image 756
Glen Little Avatar asked Nov 20 '25 05:11

Glen Little


1 Answers

The easiest thing for you to do is deploy a change to your service worker code. In that version clear your cache and remove the buggy code. Don't worry this happens a lot when you start working with service worker caching. :)

like image 112
Chris Love Avatar answered Nov 22 '25 23:11

Chris Love