_write_cache() 공개 메소드

Write Cache
public _write_cache ( string $output ) : void
$output string Output data to cache
리턴 void
예제 #1
0
 function _write_cache($output)
 {
     if ($this->is_logged_in) {
         // don't write cache if user is logged in
         return false;
     } else {
         // user isn't logged in, proceed as normal
         parent::_write_cache($output);
     }
 }
예제 #2
0
 /**
  * An override to the core CodeIgniter page cache writing mechanism to use APC
  * @param strint $output Page output
  * @return void
  */
 function _write_cache($output)
 {
     if (!function_exists('apc_add')) {
         return parent::_write_cache($output);
     }
     log_message('debug', 'Writing APC Cache');
     $CI =& get_instance();
     $uri = $CI->config->item('base_url') . $CI->config->item('index_page') . $CI->uri->uri_string();
     $cache_key = md5($uri);
     apc_store($cache_key, $output, $this->cache_expiration * 60);
     return;
 }