Reputation: 5464
I was trying to make an offline web app using ServiceWorker to cache the web requests. But I included sw.js in the cached file list.
Have I just broken my web app for all time for those who loaded my app already, or is there any way to recover? If I release a fixed sw.js file, I'm worried that my my users aren't getting the updated version, because they are using the cached sw.js...
Upvotes: 2
Views: 129
Reputation: 5253
Yes and no. You have broken it for some time but not forever.
Both Chrome and Firefox have implemented an automatic refresh interval of ~24 hours. You may read more about it from here.
This is still tricky, though, since some users might be using an older browser that doesn't automatically check for SW.js updates from the network. What could be done in that situation is not completely clear to me. If someone knows, please comment and I'll update this answer to include all the information.
Upvotes: 2