Topic on Project:Support desk

Is there a way to disable localization cache?

Likemusic (talkcontribs)

Sorry for my bad English.

The page contains this note info:

"While developing, you may want to disable caching by setting $wgMainCacheType = CACHE_NONE and $wgCacheDirectory = false, otherwise system message and other changes may not show up."

Localization cache still enabled in Database, or not? I think that this will not affect on Localization cache because in "includes/DefaultSettings.php(1844)":

 * Localisation cache configuration. Associative array with keys:
 * class:       The class to use. May be overridden by extensions.
 * store:       The location to store cache data. May be 'files', 'db' or
 *              'detect'. If set to "files", data will be in CDB files. If set
 *              to "db", data will be stored to the database. If set to
 *              "detect", files will be used if $wgCacheDirectory is set,
 *              otherwise the database will be used.
 * storeClass:  The class name for the underlying storage. If set to a class
 *              name, it overrides the "store" setting.
 * storeDirectory:  If the store class puts its data in files, this is the
 *                  directory it will use. If this is false, $wgCacheDirectory
 *                  will be used.
 * manualRecache:   Set this to true to disable cache updates on web requests.
 *                  Use maintenance/rebuildLocalisationCache.php instead.
$wgLocalisationCacheConf = array(
	'class' => 'LocalisationCache',
	'store' => 'detect',
	'storeClass' => false,
	'storeDirectory' => false,
	'manualRecache' => false,

We can see that also on $wgLocalisationCacheConf page.

As I understand it, initially Localization cache store only in file system, and $wgCacheDirectory used as trigger for disable/enable Localization cache. But than by adding future for storing localization cache in database and by mistake continue use $wgCacheDirectory as trigger. Therefore currently with parameters $wgMainCacheType = CACHE_NONE and $wgCacheDirectory = false Localisation Cache is still enebled and use datebase.

Currently is no way to disable localization cache? Am I right?

Is it a bug of mediawiki?

But in $wgCacheDirectory "Set this to false to not use any local caches." - Its mistake, because in this case localization cache still enabled and use datebase as storage?

And in Localization caching "After finding out that a large number of the cached objects above were interface messages, the bits of text that are not content, an advanced localisation cache was introduced. Set $wgCacheDirectory in LocalSettings.php to a valid path to use." - Its mistake too?

If I'm right, this may confuse extensions developers. (Its confuse me when I set hook $wgHooks['MessagesPreLoad'][] that not work, thanx debugging i find table with cache and modify expire column, for row with cached messages). I think its necessary to add in Developing extensions a note about it, somthing like this: "For rebuild Localization cache, you also should to set 'manualRecache' to true in $wgLocalisationCacheConf" and use "maintenance/rebuildLocalisationCache.php."

Nikerabbit (talkcontribs)

MediaWiki has lots of caches. I think that you are confusing the two separate caches for translations:

  1. Nowdays, the localisation cache caches messages from core and extension i18n php files. It can store the cache on the disk or in the database. It is managed via $wgLocalisationCacheConf.
  1. The second cache is called message cache, it caches messages defined in MediaWiki namespace inside the wiki itself. It can store the cache on memcached, apc, on the database etc. This cache is managed via $wgMessageCacheType.
Likemusic (talkcontribs)

As I now understand it, MessageCache has nothing to do with LocalisationCache.

I pointed out the contradictions in the documentation. I think it's a mistake that should be corrected. But I'm still not quite sure whether I am right in my judgment. And I do not know where to go next.

Maybe I should write this message to Bugzilla, and then one of developers who well versed in the architecture of the caches reply to this post?

Reply to "Is there a way to disable localization cache?"