ASP.NET 'in SqlCacheDependency PHP version

0 Cevap php

Ben C # ASP.NET uygulamaları yazarken SqlCacheDependency çok yararlı ve benim PHP uygulamalarında benzer bir şey kullanmak isterdim. Herkes bir şey önerebilirsiniz?

SqlCacheDependency caches the page page output forever, until the specified table(s) are modified in the database.

İşte ASP.NET olur ne temel jist bulunuyor:

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"]);

Yani herkes herhangi bir MySQL tablo bağımlılık tekniği biliyor mu? - Zaman-tabanlı önbelleğe alma daha temiz.

0 Cevap