Showing posts with label memcache. Show all posts
Showing posts with label memcache. Show all posts

Saturday, February 19, 2011

Memcache with CakePHP

Hi,

Memcache simply means caching your query. This means that if you are caching your query then you do not need to make a database call every time. You need to run the database query once and set a refresh time. The next time, instead of the database the query will be fetched from the cache, thus improving the performance of the site. The refresh time is the frequency of refresing the content of the cache.

For achieving this you need to install memcache in the server. But CakePHP has a inbuilt caching system, which is similiar to conventional memcaching. Here I will discuss CakePHP's inbuilt memcaching system. In this you do not need to install memcache in your server.

Assuming you are using a model, Customer. The query you are using is: