K
kbutterly
Good afternoon,
I have what appears to be a caching issue, but i'm a bit of a newbie at
http headers so it may be something else.
I have a small asp.net 2.0 application that is called to serve up some
SQL Reporting Services reports. The asp pages are running under SSL as
are the pages that call the asp app.
The asp app runs correctly, but the reports cannot be opened or saved.
I get a "The page cannot be displayed" error.
I am thinking that this is due to caching, as detailed in this MS KB
article: http://support.microsoft.com/kb/316431
I have
Response.ClearHeaders()
and then
Response.AppendHeader("Cache-control",
"public,max-age=1")
Response.ContentType = strContentType
Response.BinaryWrite(bytResult)
Response.Flush()
Response.Close()
where strContentType is defined as "application/octet-stream" and
bytResult is the Byte result of calling the render method.
I have tried using logic to use application/vnd.ms-excel or
application/pdf when applicable instead of application/octet-stream,
but that doesn't help. I
The code originally had
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName) which was to force a download,
but we really don't want the users to save the reports; we would prefer
to have them just view them. As I understand things,
Content-Disposition is used to force the file download box, which I
don't want. I just want the files to open. Do I need to use something
in place of
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName)
when I don't want a file download.
According to the KB article, I need to get rid of the Pragma:no-cache
that is coming across in the response header, but since no-cache is the
only value possible for pragma, I don't know how to do that. I tried
adding Response.AppendHeader("Pragma","") but that didn't work.
Here is the Response Header:
HTTP/1.1 200 OK
Connection: close
Date: Wed, 18 Oct 2006 17:22:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Expires: 0
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
X-AspNet-Version: 2.0.50727
Cache-Control: public,max-age=1
Content-Type: application/octet-stream
I believe that my ":Cache-Control: public,max-age=1" is overriding both
the "Cache-control: no-cache,max-age=0,must-revalidate" and the
"Expires=0", but I can't get rid of Pragma: no-cache
Any ideas, references, resources, sample code or encouraging words
would be greatly appreciated.
Thanks,
Kathryn
I have what appears to be a caching issue, but i'm a bit of a newbie at
http headers so it may be something else.
I have a small asp.net 2.0 application that is called to serve up some
SQL Reporting Services reports. The asp pages are running under SSL as
are the pages that call the asp app.
The asp app runs correctly, but the reports cannot be opened or saved.
I get a "The page cannot be displayed" error.
I am thinking that this is due to caching, as detailed in this MS KB
article: http://support.microsoft.com/kb/316431
I have
Response.ClearHeaders()
and then
Response.AppendHeader("Cache-control",
"public,max-age=1")
Response.ContentType = strContentType
Response.BinaryWrite(bytResult)
Response.Flush()
Response.Close()
where strContentType is defined as "application/octet-stream" and
bytResult is the Byte result of calling the render method.
I have tried using logic to use application/vnd.ms-excel or
application/pdf when applicable instead of application/octet-stream,
but that doesn't help. I
The code originally had
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName) which was to force a download,
but we really don't want the users to save the reports; we would prefer
to have them just view them. As I understand things,
Content-Disposition is used to force the file download box, which I
don't want. I just want the files to open. Do I need to use something
in place of
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName)
when I don't want a file download.
According to the KB article, I need to get rid of the Pragma:no-cache
that is coming across in the response header, but since no-cache is the
only value possible for pragma, I don't know how to do that. I tried
adding Response.AppendHeader("Pragma","") but that didn't work.
Here is the Response Header:
HTTP/1.1 200 OK
Connection: close
Date: Wed, 18 Oct 2006 17:22:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Expires: 0
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
X-AspNet-Version: 2.0.50727
Cache-Control: public,max-age=1
Content-Type: application/octet-stream
I believe that my ":Cache-Control: public,max-age=1" is overriding both
the "Cache-control: no-cache,max-age=0,must-revalidate" and the
"Expires=0", but I can't get rid of Pragma: no-cache
Any ideas, references, resources, sample code or encouraging words
would be greatly appreciated.
Thanks,
Kathryn