I am using redis as a read cache. I have created an initializer
config/initializer/redis.rb
$redis = Redis.new(:host => ENV[\"REDIS_HOST\"], :port =&
A more namespaced option to replace your global variable, you can create a method in a module
module Caching def self.redis ... initialize/memoize/reconnect here... end end
You than then call it with:
Caching.redis