<p>I am using URLDownloadToFile to retrieve a file from a website. Subsequent calls return the original file rather than an updated version.  I assume it is retrieving a cached version.</p>

[{'answer_id': 75452, 'author': 'AlanKley', 'author_id': 8761, 'author_profile': 'https://Stackoverflow.com/users/8761', 'pm_score': 5, 'selected': True, 'text': '<p>Call DeleteUrlCacheEntry with the same URL just prior to calling URLDownloadToFile.\nYou will need to link against Wininet.lib</p>\n'}, {'answer_id': 75518, 'author': 'Shawn Miller', 'author_id': 247, 'author_profile': 'https://Stackoverflow.com/users/247', 'pm_score': 2, 'selected': False, 'text': '<p>Could you add a harmless query parameter to the end of your URL?</p>\n\n<p><a href="https://stackoverflow.com/?CacheBuster=1020am">https://stackoverflow.com/?CacheBuster=1020am</a></p>\n'}, {'answer_id': 1375267, 'author': 'Remy Lebeau', 'author_id': 65863, 'author_profile': 'https://Stackoverflow.com/users/65863', 'pm_score': 3, 'selected': False, 'text': '<p>Yes, it is pulling a cached version of the file by default.  To avoid the cache file completely, pass an IBindStatusCallback object in the lpfnCB\nparameter of URLDownloadToFile().  In your implemented IBindStatusCallback::GetBindInfo() method, include the BINDF_GETNEWESTVERSION flag, and optionally also the BINDF_NOWRITECACHE flag, in the value you return via the grfBINDF parameter.  If you want the cache file, if present, to be updated instead of skippe, specify the BINDF_RESYNCHRONIZE flag instead.</p>\n'}, {'answer_id': 20701711, 'author': 'user3122475', 'author_id': 3122475, 'author_profile': 'https://Stackoverflow.com/users/3122475', 'pm_score': 2, 'selected': False, 'text': '<p>clean cache</p>\n\n<pre><code>// Limpa cache do Internet Explorer\nprocedure DeletaIECache;\nvar\n     lpEntryInfo: PInternetCacheEntryInfo;\n     hCacheDir: LongWord;\n     dwEntrySize: LongWord;\nbegin\n     dwEntrySize := 0;\n     FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize) ;\n     GetMem(lpEntryInfo, dwEntrySize) ;\n     if dwEntrySize &gt; 0 then lpEntryInfo^.dwStructSize := dwEntrySize;\n     hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize) ;\n     if hCacheDir &lt;&gt; 0 then\n     begin\n         repeat\n         DeleteUrlCacheEntry(lpEntryInfo^.lpszSourceUrlName) ;\n         FreeMem(lpEntryInfo, dwEntrySize) ;\n         dwEntrySize := 0;\n         FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize) ;\n         GetMem(lpEntryInfo, dwEntrySize) ;\n         if dwEntrySize &gt; 0 then lpEntryInfo^.dwStructSize := dwEntrySize;\n         until not FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize) ;\n     end;\n     FreeMem(lpEntryInfo, dwEntrySize) ;\n     FindCloseUrlCache(hCacheDir) ;\nend;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/75432', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8761/']