ASP.NET的PHP版本';SqlCacheDependency
我发现SqlCacheDependency在编写C#ASP.NET应用程序时非常有用,并且希望在我的PHP应用程序中使用类似的东西。有人能提出一些建议吗 SqlCacheDependency将永久缓存页面输出,直到在数据库中修改指定的表。 以下是ASP.NET中发生的基本jist:ASP.NET的PHP版本';SqlCacheDependency,php,asp.net,mysql,caching,sqlcachedependency,Php,Asp.net,Mysql,Caching,Sqlcachedependency,我发现SqlCacheDependency在编写C#ASP.NET应用程序时非常有用,并且希望在我的PHP应用程序中使用类似的东西。有人能提出一些建议吗 SqlCacheDependency将永久缓存页面输出,直到在数据库中修改指定的表。 以下是ASP.NET中发生的基本jist: SqlCacheDependency SqlDep = null; // Check the Cache for the SqlSource key. // If it isn't there, create
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表依赖技术吗比基于时间的缓存更干净。为什么不为此使用类似或的东西呢 编辑:我还找到了5.3.3的插件