Setting up a cache for a view in CakePHP 1.3 with cacheAction
To Set which actions to use the view cache in the controller. use cacheAction like this:
Show Plain Text
- var $cacheAction = array(
- 'posts/view/' => 60000,
- 'posts/index/' => 60000,
- 'posts/latest/' => 60000,
Note the controller, not just the action needs to be stated otherwise cake will quietly ignore you.
Then make sure you are including the Cache helper, have set Cache.check to true and Cache.disable to false in config and off you go. You can disable some parts of the view for caching using
see http://book.cakephp.org/view/1380/Caching-in-the-Controller for more details.