I’m searching google and it seems i cant find an exact answer.
I’m done installing the PHP Memcached, I can view it in phpinfo() and I was able to test the connection as per php.net manual.
My question is simple. Do I need to recode all my PHP files in order to take advantage of memcached or its a plug n play type? Is there a way to check if the PHP is actually using the memcached and not pooling same data/report from database?
Thanks in advance.
Memcached (installed from PECL) is a shared library. If it’s enable, you should be able to starting using it within your application — right away.
Check if it’s enabled
Do I need to recode all my PHP files in order to take advantage of memcached?
Yes. Memcached extends the memcache protocol/API to a PHP object. You’ll have to determine what get’s cached within your application. With objects, this is easily done be extending Memcached.
Is there a way to check if the PHP is actually using the memcached?
You can telnet directly to the Memcached server, and see what’s stored
And not pooling same data/report from database?
That’s up to you. Some people will use Memcache to store results from the database, PHP Objects, or indexes/queries to find additional data from the database. This boils down to what exactly you would like to cache. I prefer to store results from the database; such that, repetitive DB calls are reduced.