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 provides a ready-to-use Redis cloud solution that delivers numerous advantages, including:
- Redis Commander web interface included.
- Unlimited message size and transfers.
- One-click simplified updates.
- Optimal performance and enhanced security thanks to a private, dedicated infrastructure.
Save time and make your life easier: it only takes 5 minutes to try Stackhero's Redis cloud hosting solution!
To get started, you can install the "redis" gem:
bundle add redis
Next, edit the config/environments/production.rb file and add this line:
config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"] }
Finally, set the REDIS_URL environment variable. Use this URL, simply replacing <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 refer to the official Rails documentation here.