I’m using ASP.NET to load PDFs. The files are called by a simple JavaScript in the code behind:
ScriptManager.RegisterStartupScript(this, typeof(Page), "RedirectTo", "window.open('" + url + "')", true);
Is there a way to prevent IE from caching these files? Maybe something to add to the endo f the JS to prevent caching? Some files are modified based on user input, so the same file name may be a completely different file the next time the same URL is loaded.
I’ve tried deleting the file before it is modified and saved, but that did not help. The only thing that helped was a manual refresh of the IE window once the PDF had loaded into it.
Thanks!
Attach a random number to the querystring of the url. A date stamp is often used:
Which will ensure that a cached copy is not retrieved (cache varies on querystring).