开发者

How to disable Browser Caching for a specific View in ASP.NET MVC Environment?

I want to disable Browser Caching in a specific View.

I tried Response.Cache.SetCacheability(HttpCacheability.NoCache); in a controller that returns the View, but that开发者_StackOverflow does not work.

Any suggestions are greatly appreciated.

Thank you.


Try using the meta tag directly

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

put that at the top of your header. although the Response.Cache call is supposed to just put that in for you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜