开发者

how to disable cache? [duplicate]

开发者 https://www.devze.com 2023-02-27 07:29 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: asp.net mvc disable browser cache
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

asp.net mvc disable browser cache

how to disable cache for a method in asp.net mvc3?

Problem in IE9 I am saving some data on /home/ page. The page saves data and reload the pag开发者_StackOverflowe to show the newly updated result. In other browsers FF/Opera page refresh is getting new results but on IE9 its showing old data.


Response.Cache.SetCacheability(HttpCacheability.NoCache);


Just reload the page with some random parameter.

Like: /home/?rd=2823772

Make sure to always change the rd parameter to another random number on each reload. This way, IE9 will not have the page cached and it'll refresh like FF/Opera.

0

精彩评论

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