开发者

set cache-control in asp.net

How can I set cache-control to "no-cache,no-store" in ASP.NET? Do I have to implement a cache module whic开发者_StackOverflow社区h caches every response, or can it be done using OutputCache in ASPX page itself?


Response.CacheControl = "no-cache";

Response.AddHeader("Pragma", "no-cache");

Response.AddHeader("Pragma", "no-store");

Response.AddHeader("cache-control", "no-cache");

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetNoServerCaching();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜