开发者

setting cache-control header

开发者 https://www.devze.com 2023-03-18 18:56 出处:网络
I have to set cache-control header to \"no-cache, no-store\".For this i am using html meta tag <meta http-equiv=\"C开发者_StackOverflow社区ache-Control\" content=\"no-cache, no-store, must-revali

I have to set cache-control header to "no-cache, no-store".For this i am using html meta tag

<meta http-equiv="C开发者_StackOverflow社区ache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

in the tag of the web page. I inspected in firebug. In spite of having cache-control to desired one it is having as "private". I am using ASP.NET framework. Any idea why this is failing?


from code behind you add:

 Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetNoStore();
0

精彩评论

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

关注公众号