search

Home  >  Q&A  >  body text

codeigniter - PHP CI framework caching problem online etc.

CI goes to the database to query the results
If the cache is turned on in the configuration, it can be cached
But it is cached in the form of a file

If I use memcache to cache the results, is it unnecessary?

There is another question, which one is more efficient, CI’s own caching mechanism or memcache?

Waiting online

为情所困为情所困2747 days ago654

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 16:45:32

    When asking a question, it is best to state the CI version and provide as much descriptive information as possible.

    CI itself can choose from a variety of different Cache Drivers.
    Look in the configuration file and modify the cache file to

    适用于 CI 2.* 版本
    
    使用分布式 Memcached 服务器 可以通过配置文件: memcached.php 来配置,该文件在 application/config/ 目录下.
    
    $this->load->driver('cache');
    $this->cache->memcached->save('foo', 'bar', 10);
    

    reply
    0
  • Cancelreply