IIS cache control header settings
Posted
by
a_m0d
on Pro Webmasters
See other posts from Pro Webmasters
or by a_m0d
Published on 2011-06-28T20:54:31Z
Indexed on
2011/06/29
0:32 UTC
Read the original article
Hit count: 361
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?
© Pro Webmasters or respective owner