My OSX app is attempting to load a web page inside a webview. I require caching the web page for the faster laoding of the page between successive launches of the app.
All the resource files(js/css/images) linked to the page is cached except one js file of 3MB size. I verified this in the cache.db file and no entry related to this particular file is present in the related table.
I have attempted many things, including
- increasing the cache memory capacity
- increasing timeout time for the request
- changing parameters for cache policy
The workaround identified is to explicitly request the js file and forcefully store it in the cache.
[[NSURLCache sharedURLCache] storeCachedResponse:cachedURLResponse forRequest:request];
This will properly cache the file and on subsequent launches, there is only minimal network activity. This obviously is not a solution.
I'm not sure whether the file size matters, as i didn't find any reference related to size in NSURLCache documentation. One other observation is that the 'didFinishLoadForFrame' delegate is called before the linked resources are loaded.
Appreciate any help in this regard,
Thanks,
Jimesh