Advertisement
dragonbe

page caching

Aug 26th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. class UserController extends Zend_Controller_Action
  2. {
  3.     protected $_pageCache;
  4.  
  5.     public function init()
  6.     {  
  7.         $this->_pageCache = Zend_Cache::factory(
  8.             'Page',
  9.             'File',
  10.             array ('debug_header' => true),
  11.             array ('cache_dir' => '/tmp')
  12.         );
  13.     }  
  14.  
  15.     public function indexAction()
  16.     {  
  17.         $this->_pageCache->start();
  18.         $user = new Application_Model_DbTable_User();
  19.         $users = array ();
  20.         try {
  21.             $users = $user->fetchAll();
  22.         } catch (Zend_Db_Exception $e) {
  23.             echo $e->getMessage() . "<br/>";
  24.         }
  25.         $this->view->users = $users;
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement