Home
/
Website Help
/
SuperCacher
/
Memcached for MediaWiki

Memcached for MediaWiki

This article explains how to configure your MediaWiki application to use Memcached. MediaWiki natively supports Memcached. This means that you just need to enable this option.

To do this, you have to edit the MediaWiki PHP configuration file – LocalSettings.php. This file is stored inside the web root folder. Open the file and find the following two lines of code which is usually around the end of the file:

# End of automatically generated settings.
# Add more configuration options below.

Right below them add the following lines:

$wgMainCacheType= CACHE_MEMCACHED;
$wgParserCacheType= CACHE_MEMCACHED;
$wgMessageCacheType= CACHE_MEMCACHED;
$wgMemCachedServers=array("127.0.0.1:memcached_port");

Note that you should replace the memcached_port with the correct port number for your hosting account. For details on how to find out the correct port, check this tutorial.

Once you are ready with the changes to the file – save it to apply the changes. That’s it – your MediaWiki application is now configured to use Memcached.

Share This Article