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


#1

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)


#2

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


#3

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


#4

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.


#5

I’d like Jules to reply on this subject


#6

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


#7

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


#8

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


#9

reminder