redis-activesupport provides a cache for ActiveSupport. See the main redis-store readme for general guidelines.
# Gemfile
gem 'redis-activesupport'If you are using redis-store with Rails, consider using the redis-rails gem instead. For standalone usage:
ActiveSupport::Cache.lookup_store :redis_store # { ... optional configuration ... }sentinel_config = {
url: "redis://mymaster/0",
role: "master",
sentinels: [{
host: "127.0.0.1",
port: 26379
},{
host: "127.0.0.1",
port: 26380
},{
host: "127.0.0.1",
port: 26381
}]
}
# configure cache, merging opts with sentinel conf
config.cache_store = :redis_store, sentinel_config.merge(
:namespace => "cache",
:expires_in => 1.days
)
# configure sessions, setting the sentinel config as the
# servers value, merging opts with the sentinel conf.
config.session_store :redis_store, {
:servers => sentinel_config.merge(
:namespace => "sessions"
),
:expires_in => 2.days
}gem install bundler
git clone git://github.com/redis-store/redis-activesupport.git
cd redis-activesupport
bundle install
bundle exec rakeIf you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle exec rake
2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license


