Drupal Redis Configuration



Search Results

Redis is a memory-based data store that can supplement or replace the native caching that Drupal does in the RDBMS. Its primary focus is on performance by keeping cached data in memory as opposed to being written to a database.

There are two ways to enable Redis on your Drupal application. If you’re looking for a basic, default configuration, you can use the first option, which is the redis directive of your Drupal plugin. This is also the option to use if you require drush cim to enable Redis at build time.

The second is to add the settings used for Redis to your .probo.yaml file with the settingsAppend directive in the Drupal plugin. This is particularly useful if you have custom caching rules surrounding Redis on your application.

Option 1: Use redis Directive

This option is a single line in the Drupal plugin configuration:

1
2
3
4
steps:
  - name: Install Your Drupal Web Site With Redis
    plugin: Drupal
    redis: true

This will enable Redis at the end of the build process, minimizing the possibility of errors in your build. It only configures Redis with the default Redis settings and configurations for Drupal. Do not combine redis: true with custom Redis settings added through the settingsAppend directive (the second option below), as it will override any custom settings you added as part of that configuration.


Option 2: Add Settings to .probo.yaml

Your Probo.CI Drupal build can leverage Redis by ensuring the Redis contributed module is part of your Drupal site and enabled. After this is done, you can add the following to your Drupal plugin configuration:

1
2
3
4
5
6
    settingsAppend: |
      $settings['redis.connection']['interface'] = 'PhpRedis';
      $settings['redis.connection']['host'] = 'localhost';
      $settings['redis.connection']['port'] = 6379;
      $settings['cache']['default'] = 'cache.backend.redis';
      $settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml'; 

You can configure your container_yamls and cache backends by customizing these settings. Note that if you use this method, Redis must be enabled on your Drupal site and that configuration must be present in your asset database. If not, you will get errors in this build step.

It’s important to note that if your site has Redis configurations enabled in the settings.php file that are not loaded conditionally for Probo.CI or overridden by the settings above, it could lead to severe performance degradation of your Probo.CI builds.

If you receive site errors after setting this, then you likely do not have the Redis module enabled on your Probo build. This is a dependency of using Redis on your Drupal build.

Get Started with Probo.CI

Want to Try Probo today?
Get Started Fast!.

When you sign up for a Probo.CI registration code, you will get a two week trial of the plan of your choosing. For more information on how to get started, click here .

LEARN MORE ABOUT PROBO.CI'S PRICING