|Object cache setting
|Introduced in version:||1.5.0|
|Removed in version:||still in use|
|Allowed values:||One of the CACHE constants (see below)|
|Other settings: Alphabetical | By function|
Details[edit | edit source]
Object cache setting. Replaces $wgUseMemCached.
Here are the available CACHE constants, as defined in Defines.php
- CACHE_ANYTHING - Use $wgMessageCacheType or $wgParserCacheType if they are set to something other then CACHE_NONE or CACHE_ANYTHING. Otherwise use CACHE_DB.
- CACHE_NONE - Do not cache
- CACHE_DB - Store objects in the database table objectcache table. Warning: This could potentially be slower than no caching for $wgMainCacheType
- CACHE_MEMCACHED - memcached, must specify servers in $wgMemCachedServers
- CACHE_ACCEL - APC --> XCache (--> wincache, if on Windows), trying each in this order, using whichever is available
As of MediaWiki 1.18, current versions of eAccelerator no longer work. In MediaWiki 1.19 support for eAccelerator has been removed.
- CACHE_DBA (removed in 1.23) - Use PHP's DBA extension to store in a DBM-style database in $wgTmpDirectory with $wgDBAhandler
- Roan Kattouw has stated that CACHE_MEMCACHED directive will provide the most significant performance improvements in the case where you have memcached and an opcode cache installed. APC still caches (others may as well) though it is unclear if it is used in the final transaction with the client.
- This is just one of MediaWiki's caching settings. For best performance you may need to consider other caching settings, such as $wgParserCacheType. See also Squid or Varnish which can help a lot.
Custom cache types[edit | edit source]
You can also create other cache configurations in addition to the built in CACHE_ constants by adding them to $wgObjectCaches. For example, to use redis as your cache (which doesn't have a built in CACHE_XXX constant) you can do:
$wgObjectCaches['redis'] = array( 'class' => 'RedisBagOStuff', 'servers' => array( '127.0.0.1:6379' ), 'persistent' => true, ); $wgMainCacheType = 'redis';
The MediaWiki-Vagrant appliance runs a redis service and uses this configuration.