1

I just want to know because I have an issue with codeigniter database caching.

I tried to enable the cache thru the database.php file

$db['default']['cache_on'] = TRUE;
$db['default']['cachedir'] = "application/cache";

The thing is, it successfully creates the cache, I can also delete it using $this->db->cache_delete()

There's also no error. But the problem is I can't retrieve the data from the cache.

What do you guys think is the problem.. I've been looking the internet but no luck.

  • 1
    can I see, how you are trying to get cache data? – sas Dec 04 '13 at 04:34
  • can you give me a hint how should I retrieve the cache data? I have no access right now on my development PC. – user3041604 Dec 04 '13 at 05:14
  • According to the user guide (http://ellislab.com/codeigniter/user-guide/database/caching.html), cache retrieval should be automatic. Can you please post your code (or relevant snippets)? – Lorenzo Aiello Dec 04 '13 at 06:07
  • Yes, that's what I read also that no need to retrieve, it does automatically. I tried $this->cache->get('my_cached_item'); but no luck so after reading the documentation again for query caching, I remove it because it says that codeigniter does it automatically. So to summarize what I did is I just configured the database.php, and that should work. But unfortunately I cant retrieve the data.. – user3041604 Dec 04 '13 at 06:17
  • $db['default']['cache_on'] = TRUE; $db['default']['cachedir'] = "application/cache"; this is what I only did. no addtional codes just the setup – user3041604 Dec 04 '13 at 06:19
  • Check if maybe the cache directory is not writable for your script. – Thomas Aug 27 '19 at 11:53

0 Answers0