1

I am developing an offline web app for iphone. I have created the application and tested, it works fine apart of one feature, it is not being cached.

I have created the manifest file, and I checked with fiddler whether the right mime type comes in, and everything seems to be fine, when I shut down my data and wireless network connection, the application fails to open.

Does anyone has a clue for this problem?

Thanks Arian

Arian
  • 135
  • 2
  • 11

2 Answers2

4

In order to cache a web app using manifest file, the browser must be able to get all files listed in the manifest file.

Although I made sure that each file can be located from the browser, there was one missing part. The browser was looking for favicon.ico file, although it was not specified in the manifest file, and as it was not found in the directory, the application was not cached.

Immediately after putting favicon.ico file in the directory, the application started to be cached and work offline.

Arian
  • 135
  • 2
  • 11
0

There is a cache limit that you might be hitting. I believe it's around 5mb, but I'm not 100% certain.

Take a look at: http://www.thecssninja.com/javascript/how-to-create-offline-webapps-on-the-iphone

also: Max size iPad / iPhone Offline Application Cache

and: http://techblog.viewbook.com/2011/02/mobile-safari-offline-application-cache-limit/

That said, it appears that iOS 4 allows you to store more.

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245
  • I am under the 5mb limit. My web app seems to reload every time I switch back. I am using jQuery and jQuery UI. I only have the files specifically referenced in the app listed in the cache manifest file, would I need to include ALL the jQuery files? –  Jan 10 '12 at 01:41
  • @shaun5: Yes, you need to include everything it needs to run. Also, even jQuery is going to count towards your 5mb limit. – NotMe Jan 10 '12 at 01:54
  • @shaun5: another link you might want to read up on: http://forum.jquery.com/topic/problem-with-linking-when-running-offline-with-application-cache-manifest – NotMe Jan 10 '12 at 01:58
  • Hi, thanks for the answer. I reduced the size to 3.7 mb, but still am experiencing the same problem! – Arian Jan 10 '12 at 19:54
  • @chris: I have added ALL the jQuery files to my cache manifest. I have an mp3 file that stops working if it is not under the NETWORK heading. I also have several files for ajax calls that are under the NETWORK heading. My goal is to have a web app that I can switch from and come back to without reloading. Is this possible? –  Jan 16 '12 at 14:07