0

We have an iOS app, which is a wrapper (UIWebView) for our mobile site with some additional functionality (push etc).

When the site is loaded in Safari, most of it is cached, so reload is very quick (around 3s).

However, in the app, the content is not cached, resulting in much slower load (16s).

We've experimented with loading other mobile sites in our app, and they seem to cache after the first load. So there is something specific to our mobile site which is causing it not to cache.

Any ideas on what this might be, or where we can start looking?

Thanks,

Janmenjaya
  • 4,149
  • 1
  • 23
  • 43
TS00
  • 9
  • 4
  • Maybe this answers your question http://stackoverflow.com/questions/1348696/how-to-cache-content-in-uiwebview-for-faster-loading-later-on – tonik12 Sep 15 '16 at 10:48
  • You can use cache policy of NSUrlRequest like this NSURLRequest *req1 = [NSURLRequest requestWithURL:loadUrl cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:1]; – Janmenjaya Sep 15 '16 at 11:04

1 Answers1

0

You can use cache policy of NSURLRequest like this

 NSURLRequest *req1 = [NSURLRequest requestWithURL:loadUrl cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:1];
[self.wbViewInfoDtl loadRequest:req];

Hope it helps

Janmenjaya
  • 4,149
  • 1
  • 23
  • 43