Difference between revisions of "Mediawiki"

From Jon's Wiki
(Created page with "== Caching == === PHP opcache === Like any PHP application, use the opcache. If your PHP version is < 5.5 install <tt>php5-xcache</tt>, otherwise enable the built-in Zend op...")
 
Line 3: Line 3:
 
=== PHP opcache ===
 
=== PHP opcache ===
  
Like any PHP application, use the opcache. If your PHP version is < 5.5 install <tt>php5-xcache</tt>, otherwise enable the built-in Zend op-cache in php.ini:
+
Like any PHP application, use the opcache. If your PHP version is < 5.5 install <tt>php5-xcache</tt>, otherwise enable the built-in [http://php.net/manual/en/opcache.installation.php opcache] by adding this in <tt>php.ini</tt>:
  
 
  [opcache]
 
  [opcache]

Revision as of 04:08, 24 October 2014

Caching

PHP opcache

Like any PHP application, use the opcache. If your PHP version is < 5.5 install php5-xcache, otherwise enable the built-in opcache by adding this in php.ini:

[opcache]
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=0
opcache.fast_shutdown=0

MediaWiki file cache

Use the file cache, Luke. It's simple but effective. In LocalSettings.php:

$wgUseFileCache = true;
$wgFileCacheDirectory = "/var/cache/mediawiki";
$wgShowIPinHeader = false; 

And create the appropriate cache directory:

sudo mkdir -p /var/cache/mediawiki
sudo chown www-data:www-data /var/cache/mediawiki