0
C#ASP.NETアプリケーションを作成するときにSqlCacheDependencyが非常に便利で、PHPアプリケーションで同様のものを使用したいと考えています。誰かが何かを提案できますか?ASP.NETのSqlCacheDependencyのPHPバージョン
SqlCacheDependencyは、指定されたテーブルがデータベースで変更されるまで、ページページを永久にキャッシュします。
はここで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のテーブルの依存関係の技術を知っていますか? - 時間ベースのキャッシュよりはるかにクリーンです。