iOS Cache Policy behaviour UIWebView

1.5k Views Asked by At

I am using a UIWebview and load a NSMutableURLRequest into it:

NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:initialURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:10.0];
[_webview loadRequest:req];

This requests get loaded when inside another UIWebview (a kind of startpage) a link is clicked.

When looking into the network traffic with WireShark initially 150 requests are captured. Navigating back to the startpage and open the link again should then report 150 requests again, but it doesn't. Only about 100 requests are captured. The ones missing are some CSS files, PNGs, Fonts, JSON and XML.

After closing the whole application 150 requests are captured, as expected. It seems like the UIWebView itself is caching some data and ignores the set cache policy.

Is there any way to force the UIWebView loading the resources according to their policy?

0

There are 0 best solutions below