Hello there!
I read in WikiMedia FAQ there is only one caching tool for MediaWiki? Is it possible to store cached (PHP compiled pages) on the server in cache files?
Thank you, Nicolay
Nicolay A Vasiliev wrote:
Hello there!
I read in WikiMedia FAQ there is only one caching tool for MediaWiki? Is it possible to store cached (PHP compiled pages) on the server in cache files?
There are several distinct caching layers.
1. Parser cache
The parser cache stores the rendered HTML of wiki pages (just the wiki pages, not the user interface around them). Since some user options affect content, separate cached verisions may coexist for different sets of selected options.
Parser cache data is stored in memcached (if using it) or the objectcache table (by default) and autotically expires after a while. The parser cache is enabled by default on 1.4; on 1.3 it was optional and required memcached.
2. File cache
Optionally, the wiki can store the complete HTML output of basic page views for people who haven't logged in. This is optional, and off by default.
See DefaultSettings.php for the configuration; note that you *must* set the ip in header option listed next to it off also, or it won't save cached pages.
The file cache hasn't been kept up well since Wikipedia moved to Squid, but as far as I know it still works.
3. Squid reverse proxy
For a high-traffic site it can be useful to have an additional caching layer outside of PHP entirely. An appropriately configured Squid proxy can be used to keep many not-logged-in hits from even having to touch the web server. For this you'll want to engage the squid support and make sure that purges work correctly. See DefaultSettings.php for all configurable options.
Additionally, anybody running their own MediaWiki server should be sure to install a PHP opcode cache tool. Normally PHP recompiles the source code on every page view, which takes up a lot of the runtime. Turck MMCache or its descendent EAcclerator are free software and do a good job (we use Turck MMCache on the Wikimedia servers).
I should also note that web clients will cache pages, and MediaWiki tries to send appropriate headers to let the client cache while requiring that it check for updates. (A request and 304 Not Modified response is less expensive than an entire re-rendering and re-sending of a page.)
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org