Database caching with codeigniter problems

I just created a site using codeigniter and mysql. It works fine, but I want to enable database caching. I decided that I would just do it globally and not cache every select statement manually. in my database configuration file I set 'cache_on' = TRUE and then for'cachedir' = "http://www.mydomain.com/application/cache/dbcache"

I set the entire cache directory as writable, so I think everything is configured correctly. After loading several pages, I looked again at the cache directory and it is still empty. I guess this means that nothing is cached. Am I missing something? I get no errors and all my select statements show results. What am I doing wrong / and how can I find out if caching works?

Thank!

+3
source share
1 answer

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

Try changing cachedirto application/cache, for example:

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

Source: https://habr.com/ru/post/1793276/


All Articles