I'm currently working on a website that is accessed over https. We have recently come across a problem where we are unable to view .pdf
files or any other type of file that is sent as an attachment (Content-Disposition:attachment
).
According to Microsoft Knowledge Base this is due to the fact that Cache-Control
is set to no-cache
. However, we have a requirement that all pages be fully reloaded every time they are visited, so we have disabled caching on all pages (through our ASP code, not through IIS settings).
However, I have made a special case of this one page that shows the attachment, and it now returns a header with Cache-Control:private
and the expiry set to 1 minute in the future. This works fine when I test it on my local machine, using https. However, when I deploy it to our test server and try it, the response headers still return Cache-Control:no-cache
.
There is no firewall or anything between me and the server, so IIS itself must be adding these headers and replacing mine. I have no idea why it would do this, and it doesn't really make any sense, but it seems to be the only option at the moment (I haven't yet found any other place in the code that will change the cache headers).
Can anyone point me to a possible place where IIS might be setting these header values?
EDIT: It turns out that IIS wasn't messing with my cache settings. Rather, the folder I was publishing to was not the same folder that IIS was serving from. I discovered this when I examined the paths, and when I noticed that the files IIS was serving were much too old. Pointing IIS at the correct folder fixed all the problems I was having.