Redis®*: Configuring Redis as a cache system for Ruby on Rails

This documentation is part of the Using with Ruby guide. You can view the complete guide here: How to connect Redis with Ruby.

👋 Welcome to the Stackhero documentation!

Stackhero offers a ready-to-use Redis cloud solution that provides numerous benefits, including:

  • Redis Commander web UI included.
  • Unlimited message size and transfers.
  • Simplified updates with just a click.
  • Optimal performance and enhanced security powered by a private and dedicated VM.

Save time and simplify your life: it only takes 5 minutes to try Stackhero's Redis cloud hosting solution!

To get started, you might want to install the "redis" gem:

bundle add redis

Next, you can edit the config/environments/production.rb file and add this line:

config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"] }

Finally, define the REDIS_URL environment variable. You can use this URL and just replace <yourPassword> and <XXXXXX> with your information:

REDIS_URL="rediss://default:<yourPassword>@<XXXXXX>.stackhero-network.com:<PORT_TLS>"

For more information about configuring Redis as a cache system for Ruby on Rails, you can consult the official Rails documentation here.