README.md in redis-store-1.0.0.beta4 vs README.md in redis-store-1.0.0.beta5
- old
+ new
@@ -27,17 +27,17 @@
db: 13
namespace: theplaylist
password: secret
If you want to specify the `namespace` optional, you have to pass the `db` param too.
-#### __Important__: for now (beta4) `namespace` is only supported for single, non-distributed stores.
+#### __Important__: for now (beta5) `namespace` is only supported for single, non-distributed stores.
### Hash
{ :host => 192.168.1.100, :port => 23682, :db => 13, :namespace => "theplaylist", :password => "secret" }
-#### __Important__: for now (beta4) `namespace` is only supported for single, non-distributed stores.
+#### __Important__: for now (beta5) `namespace` is only supported for single, non-distributed stores.
## Cache store
Provides a cache store for your Ruby web framework of choice.
@@ -58,20 +58,20 @@
### Rails 3.x
# Gemfile
gem 'rails', '3.0.3'
gem 'redis'
- gem 'redis-store', '1.0.0.beta4'
+ gem 'redis-store', '1.0.0.beta5'
# config/environments/production.rb
config.cache_store = :redis_store, { ... optional configuration ... }
-For advanced configurations scenarios please visit [the wiki](http://wiki.github.com/jodosha/redis-store/rails).
+For advanced configurations scenarios please visit [the wiki](https://github.com/jodosha/redis-store/wiki/Frameworks-Configuration).
### Merb
- dependency "redis-store", "1.0.0.beta4"
+ dependency "redis-store", "1.0.0.beta5"
dependency("merb-cache", merb_gems_version) do
Merb::Cache.setup do
register(:redis, Merb::Cache::RedisStore, :servers => ["127.0.0.1:6379"])
end
end
@@ -81,14 +81,18 @@
require "sinatra"
require "redis-store"
class MyApp < Sinatra::Base
register Sinatra::Cache
get "/hi" do
- cache.fetch("greet") { "Hello, World!" }
+ settings.cache.fetch("greet") { "Hello, World!" }
end
end
+Keep in mind that the above fetch will return "OK" on success, not the return of the block.
+
+For advanced configurations scenarios please visit [the wiki](https://github.com/jodosha/redis-store/wiki/Frameworks-Configuration).
+
## Rack::Session
Provides a Redis store for Rack::Session. See [http://rack.rubyforge.org/doc/Rack/Session.html](http://rack.rubyforge.org/doc/Rack/Session.html)
### Rack application
@@ -144,20 +148,20 @@
### Rails 3.x
# Gemfile
gem 'rails', '3.0.3'
gem 'redis'
- gem 'redis-store', '1.0.0.beta4'
+ gem 'redis-store', '1.0.0.beta5'
# config/initializers/session_store.rb
MyApp::Application.config.session_store :redis_session_store
-For advanced configurations scenarios please visit [the wiki](http://wiki.github.com/jodosha/redis-store/rails).
+For advanced configurations scenarios please visit [the wiki](https://github.com/jodosha/redis-store/wiki/Frameworks-Configuration).
### Merb
- dependency "redis-store", "1.0.0.beta4"
+ dependency "redis-store", "1.0.0.beta5"
Merb::Config.use do |c|
c[:session_store] = "redis"
end
Merb::BootLoader.before_app_loads do
Merb::SessionContainer.subclasses << "Merb::RedisSession"
@@ -167,18 +171,20 @@
require "sinatra"
require "redis-store"
class MyApp < Sinatra::Base
- use Rack::Session::Redis
+ use Rack::Session::Redis, :redis_server => 'redis://127.0.0.1:6379/0' # Redis server on localhost port 6379, database 0
get "/" do
session[:visited_at] = DateTime.now.to_s # This is stored in Redis
"Hello, visitor."
end
end
+For advanced configurations scenarios please visit [the wiki](https://github.com/jodosha/redis-store/wiki/Frameworks-Configuration).
+
## Rack::Cache
Provides a Redis store for HTTP caching. See [http://github.com/rtomayko/rack-cache](http://github.com/rtomayko/rack-cache)
require "rack"
@@ -195,9 +201,13 @@
require "i18n"
require "redis-store"
I18n.backend = I18n::Backend::Redis.new
The backend accepts the uri string and hash options.
+
+## Unicorn
+
+Use `Rails.cache.reconnect` in your Unicorn hooks, in order to force the client reconnection.
## Running specs
gem install jeweler bundler
git clone git://github.com/jodosha/redis-store.git