Currently, I am trying to 开发者_JAVA百科write a software about ecommerce. My data is usually just MySQL queries. For instance language variable results (err_no_cat => No category found
)
Which way is the best and simple method to cache like these data in PHP?
apc
use APC if your app is using single server - you can use it as opcode and regular key=>value cache.
use memcached only if you have multiple servers and you need cache to be available to all of them - that's the point of distributed cache.
Remember that APC is about 6 times faster then memcached.
memcache is a pretty common solution. Facebook and some other big names use it. It can be very fast.
http://php.net/manual/en/book.memcache.php
精彩评论