iPhone: Performances Differences Between NSURLRequestCachePolicy Settings

后端 未结 3 655
温柔的废话
温柔的废话 2021-02-14 02:55

When using NSURLRequest on the iPhone, what are the real world performance differences between the various NSURLRequestCachePolicy settings? I am specifically interested in the

相关标签:
3条回答
  • 2021-02-14 03:21

    I just did a grep on the WebKit sources, and didn't find any use of the -[NSURLRequest cachePolicy].

    0 讨论(0)
  • 2021-02-14 03:31

    I don't think this will make any difference on your UIWebView loading times. UIWebView is built on WebKit, and they're not using NSURLConnection internally (they are at a much lower level and use CFNetwork directly).

    This is probably not what you want to hear, but probably the best way to speed up UIWebView loading time is to not use a UIWebView. Rendering web pages is pretty CPU-intensive. In fact, MobileSafari is actually mostly CPU-bound, not network-bound -- notice how long it takes it to fill in that checkerboard pattern when scrolling, for example. For really fast, quickly loading content, it's best to create a native interface in Cocoa.

    0 讨论(0)
  • 2021-02-14 03:48

    I a few hours for a project trying to get a UIWebView to cache pages I was loading. It proved impossible from the application side without storing the files locally. It seems that UIWebView ignores the NSURLRequestCachePolicy completely.

    Yahoo! has some info on the iPhone's caching behaviour.

    0 讨论(0)
提交回复
热议问题