Question

One of my programs uses InternetOpenURL without the INTERNET_FLAG_RELOAD specified. I see that the call will read the web page from the cache (if it exists). I changed the web page 5 days ago and I still get the cached version (unless I specify the flag above.) Does anyone know when or if the cache will ever be updated? I'd expect it to eventually be refreshed (possibly overly optimistic!)

Was it helpful?

Solution

Chances are the original resource had an expiration date on it that is more than 5 days, that is why the cached version keeps being used if you do not tell InternetOpenURL() to re-check the server once in awhile. However, INTERNET_FLAG_RELOAD forces it to re-download the resource whether it has actually been modified or not. That might be a little too brute force for your needs. Try using INTERNET_FLAG_RESYNCHRONIZE instead. That allows InternetOpenURL() to check if the resource has been modified and then re-download it only if needed, otherwise keep using the cached copy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top