doufei5315 2011-08-05 15:06
浏览 30
已采纳

CakePHP中的文件或APC缓存引擎?

CakePHP offers support for APC, XCache and Memcache in addition to its default caching engine. Having had some problems with my application sporadically caching broken pages for no known reason, I've decided to try another engine to see if that makes a difference.

XCache and Memcache both seem as though they might take a little bit more setup, but APC appears to be literally a case of changing one line in the core.php. My question is, where can I find information about why I should choose APC over the default engine? What are the pros and cons? It can't really be a case of "just try them both and see if one feels better than the other" (can it?), but a basic snoop around hasn't revealed a simple breakdown of the differing merits of cache engines in Cake.

Can anyone explain the mysterious workings of cache engines in Cake to me? Or point me to a resource that does? Bonus points if XCache and Memcache are also compared, because they might be my next port of call...

  • 写回答

1条回答 默认 最新

  • dony113407 2011-08-05 16:31
    关注

    Files are on disk :

    • Not quite fast ; and concurrent access are not great at all, if several processes try to read/write at the same time
    • Local to one server (if you have several servers, you'll have to store the files on each one of them -- NFS being slow)
    • But you have a lot of space


    APC is in memory :

    • Really fast
    • But you have less space
    • And it's local to each server too


    memcached is in memory, on a network cluster :

    • quite fast (a bit less than APC ; but still pretty fast)
    • Shared between all your servers : each item has to be cached only once, even if you have several webservers.
    • You can have several servers in your memcached cluster (which means virtually no limit in the size of the cache)
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证