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)
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器