I have an ASP.NET MVC application that produces a PDF file when calling an action on one of the controllers. The PDF file renders correctly in Chrome and Firefox, but when I try to open the PDF in IE, a blank HTML page appears.
The HTTP response looks like this (captured in Fiddler):
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Pragma: no-cache
Content-Type: application/pdf
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 2.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 01 Feb 2011 09:48:53 GMT
Content-Length: 3176569
<<PDF content>>
When I do a view source in IE, the following HTML appears:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>
The action is requested from a Silverlight 4 application.
If anyone knows of some quirks that IE has interpreting the HTTP protocol, please answer – it may just solve my problem. The request is made over HTTPS.
It turns out that Internet Explorer has problems when the
Cache-Controlheader has values ofno-cacheorno-storewhen serving content over HTTPS. More information can be found at http://support.microsoft.com/kb/323308.