有没有办法在web.config或global.asax中禁用缓存(System.Web.Caching.Cache,而不是aspx页面的输出缓存)或其他方式?
// Get the application configuration file.
System.Configuration.Configuration config =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/");
System.Web.Configuration.CacheSection cacheSection =
(System.Web.Configuration.CacheSection)config.GetSection(
"system.web/caching/cache");
cacheSection.DisableMemoryCollection = true;
// Save the configuration file.
config.Save(System.Configuration.ConfigurationSaveMode.Modified);