Manual:$wgMainCacheType

From MediaWiki.org
Jump to: navigation, search
Cache: $wgMainCacheType
Object cache setting
Introduced in version: 1.5.0
Removed in version: still in use
Allowed values: One of the CACHE constants (see below)
Default value: CACHE_NONE

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 anything, as long as it works
  • CACHE_NONE - Do not cache
  • CACHE_DB - Store objects in the database table objectcache table.
  • 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.


  • 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.


If using CACHE_ACCEL with APC, increasing apc.shm_size may improve performance

See also[edit | edit source]