Redis

In standalone installations the application uses a file-based storage for cache and session data. It allows the application to be used out of the box without any additional configuration. However, as application usage grows IO access can become a bottleneck. Redis is a great alternative which offers an open source, fast, in-memory, data store.

Installation

For information on how to download and install Redis, please visit https://redis.io/download.

Configuration

For details on how to set the below configuration items, please read Environment Variables.

To configure Redis the following environment variables should be used:

  • REDIS_HOST - The IP address or hostname of the Redis server.
  • REDIS_PORT - The port that Redis is running on. This environment variable is optional and defaults to 6379.
  • REDIS_USERNAME - The username to authenticate with, see Redis security recommendations.
  • REDIS_PASSWORD - The password associated with the username, see Redis security recommendations. Redis versions prior to version 6 do not need to specify a username.

Once authentication data has been configured, you can switch away from file-based storage drivers by specifying the following environment variables:


    CACHE_DRIVER=redis
    SESSION_DRIVER=redis