I have an issue with my website and IE. I have a file Document.ashx that becomes a document from my database depending on the parameter passed in the query
This issue occurs in IE8, and possibly earlier versions - but is resolved in IE9+. It is related downloading documents over SSL.
To resolve the issue in my application, I had to add the following two headers to the download (written in PHP):
header("Cache-Control: private");
header("Pragma: cache");
What's all the fuss about ? The issue is due to immediate cache expiration or no-cache.
Do the following to fix the issue:
Goto server system -> Run Inetmgr -> RightClick and properties on the folder(e.g images) -> httpHeaders ->
Now Either uncheck Enable content expiration, or check Expire after and give 1 min.
This is for IIS 5.
There will be similar setting for IIS 6/7.
Happy programming!!
Based on the KB article David offered here (Internet Explorer file downloads over SSL do not work with the cache control headers), we changed our outgoing headers away from Cache-Control: no-cache
to Cache-Control: private
. This seems to have resolved the IE8 problem without affecting other browsers. Beware of using Cache-Control: no-store
as well.
It turns out IE8 can be made to accept fully-disabled caching, but it is very picky about the exact order of the headers. So instead of falling back to private
(which allows certain caching and might not fit with your security needs) use:
Cache-Control: no-store, no-cache, must-revalidate
When specified in that exact order - first no-store
THEN no-cache
- IE8 will allow the file download without error. Be sure also that the Pragma
header is NOT set.
We had this same problem embedded in our ClickOnce deployment of www.Qiqqa.com. I suspect it has to do with the "MIME Type sniffing" that IE does when it gets an application/octet-stream
- I guess to protect the user from malicious stuff.
Anyway, to solve the problem, we changed the mime type of our .deploy
files to be text/plain
- obviously not ideal, but at the same time, I don't know a scenario where we might have a .deploy
file on our server that a user would browse to outside ClickOnce.
Problem solved.
I had the same problem and was frustrated by trying all above methods of correcting it. Obviously I did not want a solution done at client machine so all I did was just delete the "Pragma" parameter from the header and it started working nicely. PROBLEM SOLVED.