【发布时间】:2011-02-04 03:19:12
【问题描述】:
我在 ASP.NET 页面上使用 OutputCache。我在我的 Page_Load 中以这样的方式设置它:
Response.AddFileDependency(cachefilepath);
Response.Cache.SetExpires(DateTime.Now.AddHours(12));
Response.Cache.SetCacheability(HttpCacheability.Server);
Response.Cache.SetValidUntilExpires(true);
Response.Cache.SetSlidingExpiration(false);
Response.Cache.VaryByParams["*"] = true;
现在页面将被缓存,这工作正常。但是我在页面上有一个不应被缓存的 UserControl。尽管整个页面正在被缓存,是否可以为此 UserControl 禁用缓存?
原因是此 UserControl 的输出有两种状态,因此每个客户端的操作可能会有所不同...
【问题讨论】:
标签: asp.net caching outputcache