首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ASP.NET SqlCacheDependency的PHP版本

ASP.NET SqlCacheDependency的PHP版本
EN

Stack Overflow用户
提问于 2010-11-30 15:37:02
回答 1查看 629关注 0票数 0

我发现SqlCacheDependency在编写C# ASP.NET应用程序时非常有用,并且希望在我的ASP.NET应用程序中使用类似的东西。有人能提点建议吗?

SqlCacheDependency永远缓存页面输出,直到在数据库中修改指定的表。

下面是在ASP.NET中发生的事情的基本要点:

代码语言:javascript
复制
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表依赖技术吗?-比基于时间的缓存干净得多。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-11-30 15:50:04

为什么不使用像模缓存APC这样的工具呢?

编辑:我还找到了5.3.3的MySQLnd查询缓存插件。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4315471

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档