Often I do projects on Codeigniter (hereinafter CI), I have enough speed with my head. Ci is much faster than Zend (but there’s not a bad cache), so I didn’t have to use a cache. But here such a thing turned out that I am doing a fairly large project on it and I think it would not hurt to set up the cache, the database cache is good, but it seems to me not effective as for $ this-> output-> cach is also not very much like it caches the whole page on it some blocks of authorization type and user name can change. People tell me who uses what kind of caching in this framework.

did something like this

$key = md5(serialize($this->data)); if ($cache = $this->cache->file->get($key)) { echo $cache; } else { $per = 6; $this->load->library('pagination'); $config['base_url'] = base_url().'/page-'; $config['total_rows'] = $this->mod_art->get_count_index(); $config['per_page'] = $per; $config['cur_page'] = $first; $config['end_slash'] = ''; $config['first_url'] = base_url(); $config['cur_tag_open'] = '<li class="active">'; $config['cur_tag_close'] = '</li>'; $config['last_link'] = lang('last'); $config['first_link'] = lang('first'); $config['next_link'] = '<img src="/images/arrow_next.png" width="17" height="12" alt="'.lang('next').'" title="'.lang('next').'">'; $config['prev_link'] = '<img src="/images/arrow_prev.png" width="17" height="12" alt="'.lang('prev').'" title="'.lang('prev').'">'; $this->pagination->initialize($config); $this->data['pagination'] = $this->pagination->create_links(); $this->data['articles'] = $this->mod_art->get_index($first,$per); $this->data['content'] = $this->templete('main/index',true); $cache_tmp = $this->templete('main',true); $this->cache->file->save($key,$cache_tmp,300); echo $cache_tmp; } 

    1 answer 1

    Download the latest version from github - 3.0-dev

    There are now many drivers for caching

    • Sorry but download what? - ukroficer
    • already realized that CI 3.0 dev and how is it different? - ukroficer
    • There are many new features, for example, now CI supports caching: APC, Dummy, File, Memcached, Redis, Wincache. - Epexa
    • Understand how memcached works for example, then you will understand how very simple it is to use it in CI. - Epexa
    • memcached disassembled - ukroficer