Manual:$wgMainCacheType/zh

细节
允许配置使用的对象缓存.

Here are the keys available by default (defined as constants in Defines.php):


 * – Do not cache (default).
 * – Use or  if they are set to something other than   or  . 否则，请使用.
 * – 使用APCu或WinCache或OPcache（如果有）.
 * – Use if available. Servers must additionally be specified in.
 * – 使用数据库表.
 * 警告： 这可能比没有缓存要慢，即.

PHP works by compiling a PHP file into bytecode and then executing that bytecode. The process of compiling a large application such as MediaWiki takes considerable time. PHP accelerators work by storing the compiled bytecode and executing it directly reducing the time spent compiling code.

OPcache is included in PHP 5.5.0 and later and the recommended accelerator for MediaWiki. Other supported op code caches are: WinCache.

Opcode caches store the compiled output of PHP scripts, greatly reducing the amount of time needed to run a script multiple times. MediaWiki does not need to be configured to do PHP bytecode caching and will "just work" once installed and enabled them.

See for an example of a custom cache backend (e.g. Redis).