Reputation: 31
How would memcache help me in "SELECT * FROM products". As in my backend i am adding products daily. I want my visitor to see all products not just cached one ! I am bit confused in it.
Upvotes: 1
Views: 64
Reputation: 368
Caching is used to prevent calls to the database. Usually caching systems like Memcached use Memory, that's extremely fast. For instance, if you have a huge trafficked website if for each single request you have to do that select on MySQL you are wasting resources.
What you have to do is to cache the result but then refresh it only after something has changed.
I guess you have a website where you can add new products, after adding a new product you can invalidate the cached version.
About using Memcached and PHP you can read more here: http://code.tutsplus.com/tutorials/turbocharge-your-website-with-memcached--net-23939
Upvotes: 5