database caching with codeigniter problems

8.4k views Asked by At

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!

1

There are 1 answers

0
jfoucher On BEST ANSWER

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

Try changing cachedir to application/cache, like so:

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