I'm following this tutorial and trying it out on my iPad. The tutorial says:
You can wait for the application cache to update automatically or trigger an update using JavaScript. The application cache automatically updates only if the manifest file changes. It does not automatically update if resources listed in the manifest file change. The manifest file is considered unchanged if it is byte-for-byte the same; therefore, changing the modification date of a manifest file also does not trigger an update. If this is not sufficient for your application, you can update the application cache explicitly using JavaScript.
So what I've been doing to try and force updates is changing a comment in the manifest file that has a version number in it. EG, I change this line:
# Cache Manifest Version: 1.6
My html header looks like this:
<!DOCTYPE html>
<html lang="en" manifest="cache.manifest">
<head>
<meta charset="UTF-8"/>
<title>Canvas tutorial</title>
<link rel="stylesheet" type="text/css" href="app.css">
<meta name="viewport" content="width=640; user-scalable=no;"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
I've got a version of my site rendering in the iPad safari and I've added it to my homepage. If I make a change, like adding some text to the html to my app, then:
- I have to refresh twice in safari to see the change.
- I have to refresh twice in the "added to homepage version" to see the change.
- Even if I try on firefox on my desktop, it takes two refreshes to see my change.
Why does this happen? Why doesn't it work on the first refresh?
iOS 7 "Add to homepage" Update
I've discovered this documentation does not apply to an "add to homepage app" in iOS 7. The cache decides to refresh periodically and as far as I can tell, you have no control over this (maybe you do with javascript, but I haven't attempted that).
Fortunately I've found a workaround. See here: https://stackoverflow.com/a/19674061/61624