Created
April 2, 2017 08:24
-
-
Save keopx/1618ceaf124fa26f1d610b9254b5732f to your computer and use it in GitHub Desktop.
Drupal backend cache memcache OR redis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# KO memcache: http://cgit.drupalcode.org/memcache/tree/README.txt?h=8.x-2.x | |
//$settings['memcache']['servers'] = ['memcached:11211' => 'default']; | |
//$settings['memcache']['bins'] = ['default' => 'default']; | |
//$settings['memcache']['key_prefix'] = ''; | |
/** | |
* Memcache Configuration. | |
*/ | |
/* | |
$settings['memcache'] = [ | |
'servers' => [ | |
'memcached:11211' => 'default', | |
], | |
'bins' => [ | |
'default' => 'default', | |
], | |
'key_prefix' => '', | |
]; | |
$settings['cache']['default'] = 'cache.backend.memcache'; | |
$settings['cache']['bins']['render'] = 'cache.backend.memcache'; | |
*/ | |
# OK http://cgit.drupalcode.org/redis/tree/README.md | |
/** | |
* Redis Configuration. | |
*/ | |
$settings['redis.connection']['interface'] = 'PhpRedis'; // Can be "Predis". | |
$settings['redis.connection']['host'] = 'redis'; // Your Redis instance hostname. | |
$settings['redis.connection']['port'] = '6379'; // Redis port | |
# Use for all bins otherwise specified. | |
$settings['cache']['default'] = 'cache.backend.redis'; | |
# Use this to only use it for specific cache bins. | |
$settings['cache']['bins']['render'] = 'cache.backend.redis'; | |
/* | |
// Custom enabled/disabled redis cache. | |
$conf['custom_redis_cache_enabled'] = TRUE; | |
if (isset($conf['custom_redis_cache_enabled']) && $conf['custom_redis_cache_enabled']) { | |
$settings['redis.connection']['interface'] = 'PhpRedis'; // Can be "Predis". | |
$settings['redis.connection']['host'] = 'redis'; // Your Redis instance hostname. | |
$settings['redis.connection']['port'] = '6379'; // Redis port | |
# Use for all bins otherwise specified. | |
$settings['cache']['default'] = 'cache.backend.redis'; | |
# Use this to only use it for specific cache bins. | |
$settings['cache']['bins']['render'] = 'cache.backend.redis'; | |
// Note that unlike memcached, redis persists cache items to disk so we can | |
// actually store cache_class_cache_form in the default cache. | |
$conf['cache_class_cache'] = 'Redis_Cache'; | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment