Memcache Vs. Memcached

Luca Bernardi picture Luca Bernardi · Dec 1, 2009 · Viewed 120.5k times · Source

Possible Duplicate:
Using Memcache vs Memcached with PHP

Someone can explain me the difference between Memcache and Memcached in PHP environment? What are the advantages of one over the other? Can you also suggest the criteria used to choose between one or the other?

Answer

Mike Starov picture Mike Starov · Dec 3, 2010

They are not identical. Memcache is older but it has some limitations. I was using just fine in my application until I realized you can't store literal FALSE in cache. Value FALSE returned from the cache is the same as FALSE returned when a value is not found in the cache. There is no way to check which is which. Memcached has additional method (among others) Memcached::getResultCode that will tell you whether key was found.

Because of this limitation I switched to storing empty arrays instead of FALSE in cache. I am still using Memcache, but I just wanted to put this info out there for people who are deciding.