I have searched Ellis Labs docs, but I can't find any details about the $db['expressionengine']['cachedir'] setting in the database.php config file.

I recently 'fixed' this value (it was pointing to a non-existent directory) as an EE 2.8 site was running very slowly, but this caused problems for a custom plugin that inserts new channel entries by duplicating an existing entry and adding some new field values to the new entry, I'd like to understand how correcting this value caused this.

Also what effects will it actually have on a site if this value is incorrect?

Presumably it's related to $db['expressionengine']['cache_on'] (also in the database.php config file)?

Is it related to $config['enable_db_caching'] in config.php?

2 Answers 2


It is used by the CodeIgniter database drivers. $db['expressionengine']['cache_on'] is exactly what it is related to. The $db['expressionengine'] settings are passed to CodeIgniter and read based on the active record group set $active_group = 'expressionengine';.

CodeIgniter 2.x Database Configuration


As far as I can tell it's not actually used for anything. Tried searching the source for 'cachedir' and I see it is set numerous places but never used.

In DB_Driver.php there is this function, which is never actually called from anywhere:

 * Set Cache Directory Path
 * @access  public
 * @param   string  the path to the cache directory
 * @return  void
function cache_set_path($path = '')
    // Query caching now uses caching drivers

    $this->cachedir = $path;

Notice the logger->deprecated('2.8') call there. So my guess is that this is some legacy code from the good old days.

  • Thank you for your reply, it's difficult to know if this is the answer though!
    – wot
    Jan 21, 2015 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.