I’m working on an ipad webapp that will receive monthly changes.
However I can not figure out how to let the user decide weither to update the cache or not. The ipad tends to just go ahead and update when it notices a change to the manifest file. I would like to prevent this so users that haven’t finished reading this months issue can update when they feel like it. I’ve searched for a solution to this question but I fail to find any usable information.
The way my app is set up is I’ve got a content page that fetches data from the database and all the other files (appart from media that is added to the content page) is static.
I have an cache.manifest with every file in it and a version number automatically changed on update at that top in a comment.
So an update to the content means a new manifest and that means the updateReady event is fired. If anyone could give me any pointers on how to catch this and prevent it from automatically switching to the new version, that would be nice.
Thanks!
How to stop app to be updated?
In short: do not modify manifest file.
How to update manifest file for each user individually?
If user visit website first time, his browser loads current manifest, so We’d use dynamic URL and generate manifest file dynamically:
Browser remembers URL
manifest.php?version=2and every time generated manifest file remains same, so browser won’t update (manifest file is unmodified).Script file would looks like:
Now, how to force browser to load manifest form another URL, for example
manifest.php?version=5?I tried to change
manifestattribute content and callwindow.applicationCache.update()but browser requests manifest file from old URL.
Another way might be:
in manifest.php: