You have to use a relative path instead of '.'[dot].
But if you want to enabled database query caching then make your 'cache_on' to TRUE
$db['default']['cache_on'] = TRUE;
$db['default']['cachedir'] = 'application/cache';
if above line not works try this:
$db['default']['cachedir'] = APPPATH . 'cache';
After that whichever query you want to store in cache use this feature
// Turn caching on
$this->db->cache_on();
// Turn caching off for this one query
$this->db->cache_off();
Notes:
- CodeIgniter’s query caching system happens dynamically when your
pages are viewed. When caching is enabled, the first time a web page is loaded, the query result object will be serialized and stored in a
text file on your server. The next time the page is loaded the cache file will be used instead of accessing your database.
- Only read-type (SELECT) queries can be cached not Write-type (INSERT, UPDATE, etc.) queries
The caching system permits you clear caches So whenever DB updated clear related catching also.When the page loaded it again caching updated queries.
Read this for deleting caching