Manual:Cache

Wikimedia uses several caching layers. Although MediaWiki has built in support for a number of caching tools, many smaller websites using MediaWiki don't use caching at all. Generally, PHP bytecode caching is always a good idea. Application and page caching may or may not speed up a site depending on a number of factors.

Page caching
A cache server can store whole pages so that requests to view a page don't hit the MediaWiki servers at all, but instead get all their content from a cache server. This can significantly speed up page view speed for sites with a high ratio of page views to page edits. Wikimedia does page caching with Squid caches but file caching can also be used.

Application caching

 * The application cache stores objects generated by the application like a parsed page or a user session. If a page request "misses" the squid cache, the MediaWiki software might still be able to generate the page more quickly using objects stored in the application cache.  This decreases the need to do expensive operations like parsing pages and generating diffs.  The application cache can use a number of standard caching tools like eAccelerator or Memcached or can cache to a database.  The type of caching used is controlled by:
 * $wgMainCacheType for generic objects
 * $wgParserCacheType for parser objects
 * $wgMessageCacheType for interface messages objects

PHP Caching

 * PHP code can be pre-compiled into bytecode. This slightly reduces the amount of time required to run PHP code.  Wikimedia uses APC for PHP bytecode caching.