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; } /** * An override to the CI cache reading mechanism * @param object $CFG CI config object * @param object $URI CI uri object * @return */ function _display_cache(&$CFG, &$URI) { if(!function_exists('apc_add')) return parent::_display_cache ($CFG, $URI); log_message('debug', 'APC Cache Check'); $uri = $CFG->item('base_url'). $CFG->item('index_page'). $URI->uri_string; $cache_key = md5($uri); $output = apc_fetch($cache_key); if($output === FALSE) { log_message('debug', 'APC Cache Miss..'); return FALSE; } else { log_message('debug', 'APC Cache Hit. Sending to browser.'); } # Display the cached output $this->_display($output); return TRUE; } }