Posted By

yanek1988 on 10/19/11


Tagged

zend


Versions (?)

Zend Cache Page


 / Published in: PHP
 

  1. // in bootstrap
  2. $frontendOptions = array(
  3. 'lifetime' => 3600,
  4. 'default_options' => array(
  5. 'cache' => false,
  6. 'cache_with_get_variables' => false,
  7. 'cache_with_post_variables' => false,
  8. 'cache_with_session_variables' => true,
  9. 'cache_with_files_variables' => false,
  10. 'cache_with_cookie_variables' => true,
  11. 'make_id_with_get_variables' => false,
  12. 'make_id_with_post_variables' => false,
  13. 'make_id_with_session_variables' => false,
  14. 'make_id_with_files_variables' => false,
  15. 'make_id_with_cookie_variables' => false
  16. ),
  17. 'regexps' => array(
  18. '^/$' => array( 'cache' => true, 'specific_lifetime' => 900 ),
  19. '^/newses$' => array( 'cache' => true, 'specific_lifetime' => 900 )
  20. )
  21. );
  22. $backendOptions = array( 'cache_dir' => Bootstrap::$root.'/cache/' );
  23. $cache = Zend_Cache::factory( 'Page', 'File', $frontendOptions, $backendOptions );
  24. $cache->start();

Report this snippet  

You need to login to post a comment.