Tuesday, February 16, 2016

How to use Redis on all Drupal 7 cache backends

Install Redis module.
Download zip from https://github.com/nrk/predis.
Unzip in /sites/all/libraries/
Configure Redis connection via Admin Menu

Put this in settings.php
  1. define('PREDIS_BASE_PATH', DRUPAL_ROOT . '/sites/all/libraries/predis-1.0/'); $conf['redis_client_interface'] = 'Predis'; $conf['redis_client_host'] = 'YOURHOSTNAME/IP'; $conf['redis_client_port'] = 6379; $conf['cache_backends'][] = 'sites/all/modules/contrib/redis/redis.autoload.inc'; $conf['cache_default_class'] = 'Redis_Cache'; $conf['cache_class_cache'] = 'Redis_Cache'; $conf['cache_class_cache_form'] = 'Redis_Cache'; $conf['cache_class_cache_views'] = 'Redis_Cache'; $conf['cache_class_cache_page'] = 'Redis_Cache'; $conf['cache_class_cache_menu'] = 'Redis_Cache'; $conf['cache_class_cache_path'] = 'Redis_Cache'; $conf['cache_class_cache_entity_node'] = 'Redis_Cache'; $conf['cache_class_cache_entity_taxonomy_term'] = 'Redis_Cache'; $conf['cache_class_cache_entity_taxonomy_vocabulary'] = 'Redis_Cache'; $conf['cache_class_cache_entity_file'] = 'Redis_Cache'; $conf['cache_class_cache_entity_user'] = 'Redis_Cache'; $conf['cache_class_cache_filter'] = 'Redis_Cache'; $conf['cache_class_cache_admin_menu'] = 'Redis_Cache'; $conf['cache_class_cache_bootstrap'] = 'Redis_Cache'; $conf['lock_inc'] = 'sites/all/modules/contrib/redis/redis.lock.inc'; $conf['redis_client_base'] = 1;

No comments:

Post a Comment