Let's say there is a static web site. I want to use service worker and cache responses from each request. When a user clicks every possible link, a website is fully cached and it doesn't have a connection with a server. Everything is ok, but if I change some files and change cache name to say service worker to update the cache, I should wait 24 hours before service worker is updated. How can I force update the service worker? I know about this method:
SWRegistration.update();
But I don't know when my files will be changed. I can set interval and update sw every 1 hour for example, but I don't think it's a good idea. And I can't pass any parameter from a server, cause the site doesn't have access to a server (all data are in cache). Is there some practice how can it be resolved?