There is currently no way to programmatically delete the appcache, you have to respond to a request for the manifest with a 404. There is some interest at the W3C in extending the current offline capabilities, you might consider getting your use case added to the list.
Clear HTML5 Appcache when offline
-
03-12-2021 - |
Question
I have a webapp that works offline. I would like to set an expiration date to the cache so if the user does not reconnect to the server for a certain amount of time the cache is cleared and the user cannot use the application anymore.
I think the timer part is easy but I cannot find any way to delete programmatically the cache when I'm offline. I had found the way only when I'm online
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow