4

I have a NSURLCache that simply logs cachedResponseForRequest and storeCachedResponse calls.

It seems that UIWebView will call cachedResponseForRequest for every request, but storeCachedResponse will only be called for the top-level page, i.e. not for any css/js/etc. specified in the html.

Is there any reason why this might be (not) happening?

I'm observing this on 3.2 ipad simulator and device.

Roger
  • 563
  • 5
  • 12

1 Answers1

3

As far as I understand, the WebKit is using a private mechanism to get and store assets in cache. These are the aforementioned methods:

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

Note that they're using Core Foundation objects.

Roman
  • 13,100
  • 2
  • 47
  • 63