URL class and ~/Library/<my bundle name>/Caches

I’ve found that, when downloading a file by mean of the URL class under mac, the content of the file is somehow retained in the Cache.db file contained in the folder ~/Library//Caches.

Since my application has to check the content of a particular remote file every time it is run, this caching mechanism prevents it to obtain the correct data.

Any solution to this (apart from manually removing the cache file at startup, of course)

I set the URL class to use NSURLRequestUseProtocolCachePolicy as its caching policy, which seemed like a sensible option.

What about a simple boolean parameter for ignoring possible cached data?

Hi yfede ,
You could use this on 10.5 and above “NSURLRequestReloadIgnoringLocalCacheData” and on 10.4 use “NSURLRequestReloadIgnoringCacheData” instead of “NSURLRequestUseProtocolCachePolicy” if you don’t want to use any cached data, based on the bool value.

I’d like Jules to reply on this subject

I’ve no objection to the idea, just haven’t got time to do it right now.

Just for you to know, it appears that the same caching method is used both in WebBrowserComponentInternal::goToURL and juce_openInternetFile.

…eagerly waiting for this change to be committed

…I’ve seen commits to the tip but nothing regarding this…