In this code example you look if you have the data cached - if not, retrieve it from the database, and write it to the cache. On the next request, the data will come from the cache, not from the database.
I would recommend that you disable caching while doing development; you'll find (hopefully not the hard way, like me) that your models and views are not changing as expected.
CakePHP provides by default file based caching at model level also...
then also to maintain manual caching for any application you can use
type functions to maintain file based cache
For memcache or any other concept you can take the following links as reference:
In this code example you look if you have the data cached - if not, retrieve it from the database, and write it to the cache. On the next request, the data will come from the cache, not from the database.
Read the Documentation:
Before using the cache we have to check that cache is enabled or disabaled in
app/config/core.php.
we have to uncomment this line in core.php
After that we use
Check out the /app/config/core.php file.
In the Cache documentation of the manual (1.2): http://book.cakephp.org/view/213/Cache
I would recommend that you disable caching while doing development; you'll find (hopefully not the hard way, like me) that your models and views are not changing as expected.