title: strange behaviour with cache.manifest / offline usage of web app saved to home-screen on ipad ios6
body: <p>I just discovered some strange behaviour on iPad with the new iOS 6. I'm testing a web app for offline usage. The web app is no more than a static website with a cache manifest, so no special frameworks like sencha touch or tools like phnoegap are used. Just HTML, CSS and JavaScript and a cache.manifest. </p>
  
  <p>The App worked fine before: I could save the website to the home screen. When I opened it from there, all the data would be downloaded for caching. At the end of the download the pop-up would come to ask if I wanted to increase the cache to 50MB – accepted – everything was fine – offline usage worked.</p>
  
  <p>Now after the update to iOS 6:
  I made some changes to the app. Deinstalled the app from home-screen. Opened it again in mobile safari. Saved to home screen. When opened the download starts as supposed to. But then it freezes at 99%. When I look it up in the console, I get the error-message:
  "Application Cache update failed, because size quota was exceeded."</p>
  
  <p>And here comes the weird thing: When I open it in the browser, download starts and at the end I get asked if I want to increase cache size to 50MB. I confirm of course. When I now look in the preferences of safari at "website data", I see that all the cached data for this app is about 33MB!! So not at all more than 50MB! </p>
  
  <p>Is this a bug of iOS6? Did anyone experience any problems with caching data, when saving a website to the home-screen since the update to iOS 6? Thx for any help, as I am really stuck here... Couldn't find anything helpfull on the web...</p>
  
  <p>(Unfortunately I cannot post any link to the web app and/or it's files).</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I found some more information on this issue:</p>
  
  <p><a href="http://www.nsbasic.com/blog/?p=928" rel="nofollow noreferrer">http://www.nsbasic.com/blog/?p=928</a> </p>
  
  <p>Apparently wep-apps saved to the home screen are treated now like native apps, meaning each instance of the same web-app saved to the home screen gets it's own "storage sandbox". So the data is independet from the data saved in mobile Safari. This means if you delete all of mobile safari's website-data this has no effect on the web app saved to the home screen (before ios6 they shared the same data). </p>
  
  <p>I also found this: </p>
  
  <p><a href="https://stackoverflow.com/q/12503815/1254555">iOS 6 breaks GeoLocation in webapps (apple-mobile-web-app-capable)</a> </p>
  
  <p>Though not exactly the same topic, it could be related. Apparently web apps saved to the home screen using </p>
  
  <pre><code>&lt;meta content="yes" name="apple-mobile-web-app-capable" /&gt;
  </code></pre>
  
  <p>wont't be able to use geo-location. Geo-location only works when you remove this meta tag from your web app. Maybe this is also a workaround for the caching problem, I couldn't test it yet. But then again: Maybe the cache.manifest is no longer needed if the web apps saved to home screen are treated more like native apps? I will report back here if I find out more.</p>
  
  <p><strong>EDIT2:</strong> </p>
  
  <p>Ok after some testing and no useful hints from neither the web nor apple, I found out at least something: When I remove </p>
  
  <pre><code>&lt;meta content="yes" name="apple-mobile-web-app-capable" /&gt;
  </code></pre>
  
  <p>from the site everything of course works fine, because it's just like you open Safari and there I had no problem so far. So my interest is to make it work without the browser chrome. As described above the caching only goes to 99% and then I get the cache size quota exceeding error. Then I just closed the home screen app and opened it again. Now the caching downloads start again and complete just fine! No freezing, no error! And everything seems to be stored localy. I could only test it on the iPad simulator today but I hope I can confirm this as soon as I can get my hands on our device later.</p>
  
  <p>So it seems like instead of being asked if you want to increase the cache size you get the cache size quota exceeding error. Maybe because data storage for home screen apps now is handled differently you don't have to manualy increase the cache size anymore (which of course is pure speculation). Still, if this was the case, there should not be any error. So instead of being asked to increase cache size you have to open the home screen app twice, which is a pretty lame workaround btw...</p>
  
  <p><strong>EDIT3:</strong> </p>
  
  <p>I just could confirm this behaviour on a real device: saved to home screen -> opened from home screen -> download to be cached files -> cache size quota exceeding error at the end -> close home screen app (press home button) -> reopen it again -> to be cached files download again -> this time without error -> everthing usable offline. </p>
  
  <p>I also tested it on a device with iOS 5 and there it works like expected without errors. So this is definitely an iOS 6 issue.</p>
  
  <p>Can anyone else confirm this behaviour or bug?</p>
  
  <p><strong>EDIT4:</strong></p>
  
  <p>I occasionally had the chance to test this on iOS 6.1.3 – unfortunately still the same behaviour...</p>