我添加了<%@ OutputCache Location="server" VaryByParam="*"%>指令asp.net页。web应用程序通过Visual Studio开发服务器、IIS Express和IIS 7.5在本地计算机上部署。我可以在哪里找到机器上的缓存文件,以验证根据各种查询字符串组合生成的不同版本的缓存页面?
谢谢,雅各布
发布于 2012-10-30 21:55:49
默认情况下,输出缓存将呈现的网页标记和用户控件存储在ASP.NET服务器的内存中。..。使用ASP.NET 4,可以创建自定义输出缓存提供程序,将呈现的输出存储到其他地方-磁盘、云、分布式缓存体系结构等。
示例:
public override void Set(string key, object entry, DateTime utcExpiry)
{
var item = new DiskOutputCacheItem(this.GetSafeFileName(key), utcExpiry);
WriteCacheData(item, entry);
// Add item to CacheItems, if needed, or update the existing key, if it already exists
lock (_lockObject)
{
if (this.CacheItems.ContainsKey(key))
this.CacheItems[key] = item;
else
this.CacheItems.Add(key, item);
}
}https://stackoverflow.com/questions/13140399
复制相似问题