ASP.NET的SQLCACHEDEPENTINCY的PHP版本
-
29-09-2019 - |
题
在编写C#ASP.NET应用程序时,我发现SQLCACHEDEPTINCY非常有用,并且很想在我的PHP应用程序中使用类似的东西。谁能建议什么?
SQLCACHEDEPTINCENCE永远缓存页面页面输出,直到在数据库中修改指定的表为止。
这是ASP.NET中发生的事情的基本JIST:
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表依赖技术吗? - 比基于时间的缓存更干净。
解决方案
为什么不使用类似的东西 memcache 或者 APC 为了这?
编辑:我也发现 mysqlnd查询缓存 5.3.3的插件。
不隶属于 StackOverflow