overwriting http headers set in iis

overwriting http headers set in iis

am 21.01.2008 23:30:22 von Zester

Hi,

My application have these headers added in IIS:
Pragma:No-cache
Cache-control: No-cache, no-store

That's what we want for all pages except for when we need to allow users to
download pdf file; with those headers; IE would not be able to get the pdf
file because it needs to store the file locally. Is there a way to overwrite
the headers for only a few pages ?

thank you very much

Re: overwriting http headers set in iis

am 22.01.2008 02:23:43 von Ken Schaefer

Easiest way would be to put all these files into a single folder (or
folders).

And then in IIS Manager, configure that folder to not have those HTTP
headers added.

Cheers
Ken

"Zester" wrote in message
news:eHLnV0HXIHA.1208@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> My application have these headers added in IIS:
> Pragma:No-cache
> Cache-control: No-cache, no-store
>
> That's what we want for all pages except for when we need to allow users
> to download pdf file; with those headers; IE would not be able to get the
> pdf file because it needs to store the file locally. Is there a way to
> overwrite the headers for only a few pages ?
>
> thank you very much
>
>

Re: overwriting http headers set in iis

am 22.01.2008 04:25:05 von David Wang

On Jan 21, 2:30=A0pm, "Zester" wrote:
> Hi,
>
> My application have these headers added in IIS:
> Pragma:No-cache
> Cache-control: No-cache, no-store
>
> That's what we want for all pages except for when we need to allow users t=
o
> download pdf file; with those headers; IE would not be able to get the pdf=

> file because it needs to store the file locally. Is there a way to overwri=
te
> the headers for only a few pages ?
>
> thank you very much


It depends on how you added those headers:
- If your application code adds the headers, then you should fix the
application code to not add the headers for downloadable files.
- If you use HttpCustomHeaders to add the headers to static files,
then you can use HttpCustomHeaders for each file and selectively
disable the added headers
- In all cases, you can write ISAPI Filter to overwrite the response
headers, but this is the most expensive and least performant method.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//