Skip to content

Instantly share code, notes, and snippets.

@cleaver
Created October 29, 2015 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleaver/09ce8c224b2930f75275 to your computer and use it in GitHub Desktop.
Save cleaver/09ce8c224b2930f75275 to your computer and use it in GitHub Desktop.
Drupal Redis cache settings
$conf['redis_client_interface'] = 'PhpRedis';
// environment variable: MY_REDIS_HOST
$conf['redis_client_host'] = getenv(‘MY_REDIS_HOST');
$conf['lock_inc'] = 'sites/all/modules/contrib/redis/redis.lock.inc';
$conf['path_inc'] = 'sites/all/modules/contrib/redis/redis.path.inc';
$conf['cache_backends'][] = 'sites/all/modules/contrib/redis/redis.autoload.inc';
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;
// Use if connecting to Redis by socket
// $conf['redis_cache_socket'] = '/var/run/redis/redis.sock';
$conf['page_cache_invoke_hooks'] = FALSE;
$conf['page_cache_without_database'] = TRUE;
// Cache bins.
$conf['cache_default_class'] = 'Redis_Cache';
$conf['cache_class_cache_bootstrap'] = 'Redis_Cache';
$conf['cache_class_cache'] = 'Redis_Cache';
$conf['cache_class_cache_menu'] = 'Redis_Cache';
$conf['cache_class_cache_block'] = 'Redis_Cache';
$conf['cache_class_cache_views'] = 'Redis_Cache';
$conf['cache_class_cache_views_data'] = 'Redis_Cache';
$conf['cache_field'] = 'Redis_Cache';
$conf['cache_class_cache_field'] = 'Redis_Cache';
$conf['cache_class_cache_image'] = 'Redis_Cache';
$conf['cache_class_cache_libraries'] = 'Redis_Cache';
$conf['cache_class_cache_metatag'] = 'Redis_Cache';
$conf['cache_entity_node'] = 'Redis_Cache';
$conf['cache_entity_fieldable_panels_pane'] = 'Redis_Cache';
$conf['cache_entity_file'] = 'Redis_Cache';
$conf['cache_entity_taxonomy_term'] = 'Redis_Cache';
$conf['cache_entity_taxonomy_vocabulary'] = 'Redis_Cache';
// Dont’t use Redis for form cache
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
@cleaver
Copy link
Author

cleaver commented Oct 29, 2015

Added to settings.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment