开发者

Will an image or document be cached when it is viewed through UIWebView in iOS?

Typically when we load a image or document through a browser, the image gets cached in a temp folder. Is this the same case for Mobile safari and other browsers in MObil开发者_开发技巧e?

And if that is the case, if the phone is rooted, will user be able to access them? Will an image or document be cached when it is viewed through UIWebView in iOS?


No, the class doing the caching is NSURLRequest. You can remove the cache for a particular request

[[NSURLCache sharedURLCache] removeCachedResponseForRequest:request];

or for all of them

[[NSURLCache sharedURLCache] removeAllCachedResponses];

or set an empty cache before performing any request

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜