【问题标题】:PHP version of ASP.NET's SqlCacheDependencyASP.NET 的 SqlCacheDependency 的 PHP 版本
【发布时间】:2010-12-02 00:44:38
【问题描述】:

我发现 SqlCacheDependency 在编写 C# ASP.NET 应用程序时非常有用,并且希望在我的 PHP 应用程序中使用类似的东西。任何人都可以提出一些建议吗?

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

以下是 ASP.NET 中发生的基本情况:

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 表依赖技术? - 比基于时间的缓存更干净。

【问题讨论】:

    标签: php asp.net mysql caching sqlcachedependency


    【解决方案1】:

    为什么不为此使用MemcacheAPC 之类的东西?

    编辑:我还刚刚找到了 5.3.3 的 MySQLnd Query Cache 插件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多