Php – Memcached vs APC which one should I choose?


I read this article: from way back when.. I want to get the best caching engine available so that my application is really fast. Of course I don't want to over-cache but I want to at least choose the best thing out there. In that article it says Memcached is slow and apc is fast so why is everyone choosing memcached? here is says "use a fast one (but limited) like Apc, Memcache… and a "slow" one like File, Sqlite…" do you think using Apc as the fast and Memcache as the slow is a good idea?

Best Solution

Memcached is a distributed caching system, whereas APC is non-distributed - and mainly an opcode cache.

If (and only if) you have a web application which has to live on different webservers (loadbalancing), you have to use memcache for distributed caching. If not, just stick to APC and its cache.

You should always use an opcode cache, which APC is (also APC will get integrated into php6 iirc, so why not start using it now).

You can/should use both for different purposes.