I am trying to build an iPad app which has one UIWebview. content is in asp.net. Now one of major requirement is that my app should support offline mode.
First I tried looking Html5 cache manifest but as per this SO Answer it does not work with UIWebview
Then I tried searching around caching mechanism available with UIWebview, I found many question on SO(This,This,This,This) but nothing comes to conclusion or may be old in this context.
my basic requirement is whichever page user browse that should get cache(html,css,js.images) and next time when user visit the same page it should be delivered from cache.
So my questions are
1) How do achieve this using either Html5 cache manifest or UIWebview caching
2) My app uses lots of image some of them are in MB so is there any size limitation
I would really appreciate if anybody can provide a complete tutorial reference.
Thanks.
**UPDATE: ** is it possible i can take advantage of local disk cache(for images) and html5 local storage (for data) together? if yes then how do i provide local image path.?
3 Answers
It looks like the reference referred to in your question is no longer relevant
First I tried looking Html5 cache manifest but as per this SO Answer it does not work with UIWebview
The latest accepted answer for that question indicates that HTML5 cache manifest is supported for UIWebView as of iOS 4.0 as long as the mime type of your manifest file is properly set as text/cache-manifest
.
I would give ASIWebPageRequest a try. It's still listed as experimental, so it's not quite fully baked, but it's meant to do precisely what you're asking for.

- 12,142
- 3
- 43
- 40
-
Thanks Robot...but is there any storage limitation? – Nnp Oct 06 '10 at 20:20
-
I don't know, I haven't had the opportunity to try it myself yet. – Kris Markel Oct 06 '10 at 20:28
-
I tried,seem like no limitation. But the problem is that you need wait long time if you need it to download big video. – Forrest Jun 16 '11 at 01:37
-
This is an excellent solution. I've just finished a big ipad project to do exactly this using ASIWebPageReqeust. The application uses a custom web-based cms to build webpages using a WYSIWYG, then the app sources the content using a json webservice to hand over the urls. The only gotcha is you need to be sure that you don't use any code on the downloaded webpages that downloads at runtime (ajax). – ransomweaver Jan 23 '12 at 01:33
You can use HTML5 Offline storage to store your app code and data.However you still need a simple bootstrapper js code to load the app (basically eval) from offline storage. You can also store small images (base64 encoded) in offline storage. The downside is you have to roll your own versioning and update local storage if there's a newer version of the app.

- 159
- 6
-
1storage limit for HTML5 Offline storage is limited to 5MB in IPhone. Not sure on IPad. – Ibrahim Okuyucu Jan 26 '11 at 22:47
-
Thanks. i have test Offline storage limit on iPad is 5MB.However if your storage grows over 5MB i will popup en message asking user to allow storage to grow. i was able to insert data upto 50MB. though it asked me 5 times to allow :) – Nnp Jan 28 '11 at 19:44
-
@d.ennis as I mentioned I was able to store up to 50MB of course with user permission, but eventually we ended up building native app as we wanted to store up to 500 MB data. – Nnp Mar 12 '13 at 18:59
-
@Nnp and thats not possible if you use the application cache? I need to save something like 200MB. – d.ennis Mar 14 '13 at 12:13
-
@d.ennis somehow UIWebview was ignoring application manifest file, so I was not able to verify HTML application cache. I have no idea whats the current improvement in UIWebView.. – Nnp Mar 15 '13 at 18:56