I can’t make element caching work:
echo $this->element('categorytree', array(
'cache' => array(
'key'=>'categorytree-cache','time' => '+1 hour'
)
))
I checked core.php:
// In development mode, caches should expire quickly.
$duration = '+999 days';
/*if (Configure::read('debug') >= 1) {
$duration = '+10 seconds';
}*/
And commented as you see – to prevent short caching in debug mode…
But still when I refresh page the SQL query that cached element does by requestAction() is shown… So no caching… why?
I may be wrong here, but I think the correct call would be:
Notice the second argument is element params while the third is element options (what you need here).
You can see the function signature here.