开发者

Cache-control in IIS6 not working

I'm using IIS 6 and add开发者_高级运维ed Cache-Control: no-cache header in IIS management console for entire website. However, when inspecting returned content with fiddler, I still see that Cache-Control: private is sent back to browser along with the response. No Cache-control: no-cache is sent though... Any ideas why?

On the other hand, when I used EndRequest method in Global.asax and set:

protected void Application_EndRequest(Object sender, EventArgs e)
{
    HttpContext.Current.Response.CacheControl = "no-cache";
}

I saw following headers in HTTP response:

Cache-Control: no-cache
Pragma: no-cache
Expires: -1

But I have a great deal of applications and would like to set the no-cache in one place, like IIS.

Thanks, Pawel


i know only one 100% no-cache technique - generate a "random" param e.g. 'myscript.aspx?myparam1=val1&myparam2=va21&...&r='+Math.random();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜