save cached config when saving database config, fixes #311