开发者

Cache-control in IIS6 not working

开发者 https://www.devze.com 2023-01-21 08:59 出处:网络
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-Co

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

精彩评论

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