互联网浏览器缓存ASP.NETMVC阿贾克斯结果互联网、缓存、浏览器、结果

2023-09-10 13:25:02 作者:丢了少年失了心?

我有一个问题,在Internet Explorer中的页面。 我有一个Ajax调用,调用形式,在其他浏览器中,当我点击控制器传递的链接,并加载正确的数据。但在IE浏览器,当其装载一次,跳投带给我同样的老结果没有通过在控制器中。

I'm having an issue with a page in internet explorer. I have an ajax call that calls a form, in other browser, when I click the link it passes in the controller and load correctly data. but in IE, when its loaded once, it aways brings me the same old results without passing in the controller.

推荐答案

尝试:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]

这个属性,放在控制器类,禁用缓存。因为我没有在我的应用程序需要缓存,我把它放在我的BaseController类:

This attribute, placed in controller class, disables caching. Since I don't need caching in my application, I placed it in my BaseController class:

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public abstract class BaseController : Controller
{

下面是关于OutputCacheAttribute很好的说明:与提高性能输出缓存

Here is nice description about OutputCacheAttribute: Improving Performance with Output Caching

您可以将其放置在行动了。

You can place it on action too.

 
精彩推荐
图片推荐