Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database caching with codeigniter problems

I've just built a site using codeigniter and mysql. It works great, but I want to turn the database caching on. I figured I would just do it globally rather than caching each select statement manually. in my database config file, I set 'cache_on' = TRUE and then for the 'cachedir' = "http://www.mydomain.com/application/cache/dbcache"

I set the whole cache directory as writable, so I think everything is set up correctly. After loading a few pages, I looked back into the cache directory, and it's still empty. I'm assuming that means that nothing was cached. Am I missing something? I'm not getting any errors and all my select statements are showing the results. What am I doing wrong / and how can I tell if the caching is working?

Thanks!

like image 570
Bill Avatar asked Feb 19 '11 18:02

Bill


1 Answers

You need to use a relative path, not a url.

Try changing cachedir to application/cache, like so:

$db['default']['cachedir'] = 'application/cache';
like image 75
jfoucher Avatar answered Oct 13 '22 18:10

jfoucher