php - How do you turn on the cache in CakePHP? -


i using cakephp. have action in controller produces static content pages of app. want cache entire action/view. controller pages , action main. not seeing cached files view appear in tmp/cache folder.

  • i have uncommented cache.check setting in core.php, reads:

    configure::write('cache.check', true);

  • i have added cache helper pages controller:

    var $helpers = array('javascript','cache');

  • i have told controller cache action called "main":

    var $cacheaction = array('main/'=>86400);

  • i have confirmed there other cache files (the model cache) in app/tmp/cache folder today, know isn't permissions issue.

here top of pages controller:

var $name = 'pages'; var $helpers = array('javascript','cache'); var $uses = array(); var $components = array('authentication','security'); var $cacheaction = array('main/'=>86400); 

i not sure missing enable cache of view in cachephp. missing something? ideas?

dumb checks, sorry, make sure:

capitalise words 'javascript' , 'cache'

i.e. var $helpers = array('javascript','cache'); not have pasted.

ensure you've added

var $cacheaction = array('main/'=>86400); ,

var $helpers = array('javascript','cache');

at class level in appropriate controller.

it might worth trying helper declaration in app_controller.

i don't know if you're on windows or more sensible. if you're on linux or osx or whatever, in console window, change directory app/tmp , chmod -r 777 . it's worthwhile recursively chown & chgrp whatever web user is, too.

delete cache files - leave directories there.

try again.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -