我添加<%@ OutputCache Location="server" VaryByParam="*"%>
指令 asp.net 页面。Web 应用程序通过 Visual Studio Development Server、IIS Express 和 IIS 7.5 部署在本地计算机上。我在哪里可以找到机器上的缓存文件来验证是否生成不同版本的缓存页面取决于各种查询字符串组合?
谢谢,雅各布
默认情况下,输出缓存将 ASP.NET 页面和用户控件的呈现标记存储在 Web 服务器的内存中。... 使用 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);
}
}