MediaWiki-Docker/Configuration recipes/Redis

From mediawiki.org
Jump to navigation Jump to search

Redis[edit]

You can use Redis for performance gains or if you want to test using Redis as a cache backend.


docker-compose.override.yml
version: '3.7'
services:
  redis:
    image: redis
LocalSettings.php
$wgObjectCaches['redis'] = [
	'class' => 'RedisBagOStuff',
	'servers'=> [ 'redis:6379' ],
];
$wgMainCacheType = 'redis';
$wgSessionCacheType = 'redis';
$wgMainStash = 'redis';
// You can also use Redis for the JobQueue backend.
$wgJobTypeConf['default'] = [
	'class' => 'JobQueueRedis',
	'redisServer' => 'redis:6379',
	'redisConfig' => [],
	'claimTTL' => 3600,
	'daemonized' => true
];