Exemplo n.º 1
0
 protected function afterAction($action)
 {
     parent::afterAction($action);
     //        echo 'after';
     if ($this->_conf['cache_page_status'] == 'open') {
         $cacheTime = $this->_conf['cache_page_time'];
         $cacheId = $this->_thisUrl;
         ob_start();
         $pageData = ob_get_contents();
         if (Yii::app()->cache->set($cacheId, $pageData, $cacheTime)) {
             //记录
             echo '写入cache';
             CacheData::_addMycache('页面缓存', $cacheId, $cacheTime, $this->_thisUrl);
         }
     }
 }