title: Query caching in CodeIgniter
body: <p>I want to cache a query in CodeIgniter. What I did for my test is make a controller, that I named <code>show.php</code>:</p>
  
  <pre><code>class Show extends CI_Controller{
  public function __construct() 
  {
      parent::__construct();
      $this-&gt;load-&gt;model('rejaal_show');
  }
  
  public function _remap($method = '',$param = array())
  {
      $method = intval($method);
      $this-&gt;output-&gt;cache(5);
      var_dump ($this-&gt;rejaal_show-&gt;temp($method));
  }
  }
  </code></pre>
  
  <p>And a model that I named <code>rejaal_show.php</code>:</p>
  
  <pre><code>public function temp($id)
  {
      $this-&gt;db-&gt;cache_on();
      $this-&gt;db-&gt;where('id',$id);
      $query = $this-&gt;db-&gt;get('system_store_table');
      return $query-&gt;result();
  }
  </code></pre>
  
  <p>When I call <code>http://localhost/rejaal/show/1</code> for the first time, it will show a result, but when I call it for the second time, it does not show anything.</p>
  
  <p>I should delete the query cache file to show it again? How should I solve this problem?</p>
  
  <p>With special thanks for your attention.</p>