Manual:$wgWANObjectCaches/zh

From Linux Web Expert

<translate> Cache</translate>: $wgWANObjectCaches
Advanced Wide-Area-Network cache configuration.
<translate> Introduced in version:</translate>1.26.0 (Gerrit change 187074; git #3a1f8b11)
<translate> Removed in version:</translate>1.40.0 (Gerrit change 889244; git #39ead04e)
<translate> Allowed values:</translate>(数组)
<translate> Default value:</translate>参见下方

细节

Each WAN cache wraps a registered object cache (for the local cluster) and it must also be configured to point to a PubSub instance via a EventRelayer subclass. Subscribers to that instance must be configured to relay purges to the actual cache servers. For typical setups where there is only one cache server, a no-op PubSub instance can be used (EventRelayerNull). This can also be done if there is only one datacenter, assuming either (a) cache network problems are rare enough, or (b) client side cache server fail-over is disabled, or (c) the caching store automatically shards, replicates, and moves data around as nodes fail.

The format is an associative array where the key is a cache identifier, and the value is an associative array of parameters.

  • cacheId - a cache identifier from $wgObjectCaches.
  • relayerConfig - an array used to construct an EventRelayer object.
  • pool - a string that is used as a PubSub channel prefix.
  • loggroup - controls where log events are sent.

默认值

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.35
<translate> MediaWiki version:</translate>
$wgWANObjectCaches = [
	CACHE_NONE => [
		'class' => WANObjectCache::class,
		'cacheId' => CACHE_NONE,
	]
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.34</tvar> is unsupported version</translate>">
1.33 – 1.34
<translate> MediaWiki versions:</translate>
$wgWANObjectCaches = [
	CACHE_NONE => [
		'class'    => WANObjectCache::class,
		'cacheId'  => CACHE_NONE
	]
	/* Example of a simple single data-center cache:
	'memcached-php' => [
		'class'    => WANObjectCache::class,
		'cacheId'  => 'memcached-php'
	]
	*/
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.32</tvar> is unsupported version</translate>">
1.31 – 1.32
<translate> MediaWiki versions:</translate>
$wgWANObjectCaches = [
	CACHE_NONE => [
		'class'    => WANObjectCache::class,
		'cacheId'  => CACHE_NONE,
		'channels' => []
	]
	/* Example of a simple single data-center cache:
	'memcached-php' => [
		'class'    => WANObjectCache::class,
		'cacheId'  => 'memcached-php',
		'channels' => [ 'purge' => 'wancache-main-memcached-purge' ]
	]
	*/
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.30</tvar> is unsupported version</translate>">
1.27 – 1.30
<translate> MediaWiki versions:</translate>
$wgWANObjectCaches = [
	CACHE_NONE => [
		'class'    => 'WANObjectCache',
		'cacheId'  => CACHE_NONE,
		'channels' => []
	]
	/* Example of a simple single data-center cache:
	'memcached-php' => [
		'class'    => 'WANObjectCache',
		'cacheId'  => 'memcached-php',
		'channels' => [ 'purge' => 'wancache-main-memcached-purge' ]
	]
	*/
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.26</tvar> is unsupported version</translate>">
1.26
MediaWiki版本:
$wgWANObjectCaches = array(
	CACHE_NONE => array(
		'class'         => 'WANObjectCache',
		'cacheId'       => CACHE_NONE,
		'pool'          => 'mediawiki-main-none',
		'relayerConfig' => array( 'class' => 'EventRelayerNull' )
	)
	/* Example of a simple single data-center cache:
	'memcached-php' => array(
		'class'         => 'WANObjectCache',
		'cacheId'       => 'memcached-php',
		'pool'          => 'mediawiki-main-memcached',
		'relayerConfig' => array( 'class' => 'EventRelayerNull' )
	)
	*/
);