gpt4 book ai didi

iphone - UIWebView 和 NSUrlCache

转载 作者:行者123 更新时间:2023-12-03 19:16:16 29 4
gpt4 key购买 nike

我有一个 NSURLCache,它只记录 cachedResponseForRequest 和 storeCachedResponse 调用。

似乎 UIWebView 会为每个请求调用 cachedResponseForRequest,但 storeCachedResponse 只会为顶级页面调用,即不会为任何 css/js/等调用。在 html 中指定。

有什么原因导致这种情况可能(不会)发生吗?

我在 3.2 ipad 模拟器和设备上观察到这一点。

最佳答案

据我了解,WebKit 使用私有(private)机制在缓存中获取和存储资源。这些是前面提到的方法:

- (CFCachedURLResponse*)_nscfBridgeURLCacheCopyResponseForRequest:(CFURLRequest*)request;
- (void)_nscfBridgeURLCacheStoreCachedResponse:(CFCachedURLResponse*)cachedResponse forRequest:(CFURLRequest*)request;

请注意,他们正在使用 Core Foundation 对象。

关于iphone - UIWebView 和 NSUrlCache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3169630/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com