开发者

setting cache-control header

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜