我发现SqlCacheDependency在编写C# ASP.NET应用程序时非常有用,并且希望在我的ASP.NET应用程序中使用类似的东西。有人能提点建议吗?
SqlCacheDependency永远缓存页面输出,直到在数据库中修改指定的表。
下面是在ASP.NET中发生的事情的基本要点:
SqlCacheDependency SqlDep = null;
// Check the Cache for the SqlSource key.
// If it isn't there, create it with a dependency
// on a SQL Server table using the SqlCacheDependency class.
if (Cache["MyCache"] == null) {
SqlDep = new SqlCacheDependency("DatabaseName", "TableName");
// Perform action to be cached ...
var result = DatabaseIntensiveFunction();
Cache.Insert("MyCache", result, SqlDep);
}
else {
// The data was retrieved from the Cache.
}
// Output page from cache.
Output(Cache["MyCache"]);那么,有谁知道MySql表依赖技术吗?-比基于时间的缓存干净得多。
发布于 2010-11-30 15:50:04
为什么不使用像模缓存或APC这样的工具呢?
编辑:我还找到了5.3.3的MySQLnd查询缓存插件。
https://stackoverflow.com/questions/4315471
复制相似问题