• Install Redis

    Download and build from scratch:

    $ wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz
    $ tar xzf redis-2.2.12.tar.gz
    $ cd redis-2.2.12
    $ make
                    
    Install the gem

    On *NIX you may need to sudo:

    $ gem install redis-store
                    
  • You can specify the Redis configuration details using a URI or a hash. By default the gem will attempt to connect to localhost port 6379 and the db 0.

    URI usage

    For example

    "redis://:secret@192.168.1.100:23682/13/theplaylist"
                    

    Made up of the following:

    host: 192.168.1.100
    port: 23682
    db: 13
    namespace: theplaylist
    password: secret
                    
  • Provides a cache store for your Ruby web framework of choice.

    Rails 3.x
    # Gemfile
    gem 'redis'
    gem 'redis-store', '1.0.0.rc1'
    
    # config/environments/production.rb
    config.cache_store = :redis_store, { ... optional configuration ... }
                    
  • Provides a Redis store for Rack::Session.

    Rack application
    require "rack"
    require "redis-store"
    require "application"
    use Rack::Session::Redis
    run Application.new
                    
  • Provides a Redis store for HTTP caching.

    Rack application
    require "rack"
    require "rack/cache"
    require "redis-store"
    require "application"
    use Rack::Cache,
      :metastore   => 'redis://localhost:6379/0/metastore',
      :entitystore => 'redis://localhost:6380/0/entitystore'
    run Application.new
                    
  • The backend accepts the uri string and hash options.

    require "i18n"
    require "redis-store"
    I18n.backend = I18n::Backend::Redis.new
                    

Support us

Please, make an offer to support us.
More about us