README.md in dalli-2.7.0 vs README.md in dalli-2.7.1

- old
+ new

@@ -92,10 +92,16 @@ ```ruby config.cache_store = :dalli_store, 'cache-1.example.com', 'cache-2.example.com', { :namespace => NAME_OF_RAILS_APP, :expires_in => 1.day, :compress => true } ``` +If your servers are specified in `ENV["MEMCACHE_SERVERS"]` (e.g. on Heroku when using a third-party hosted addon), simply provide `nil` for the servers: + +```ruby +config.cache_store = :dalli_store, nil, { :namespace => NAME_OF_RAILS_APP, :expires_in => 1.day, :compress => true } +``` + To use Dalli for Rails session storage that times out after 20 minutes, in `config/initializers/session_store.rb`: For Rails >= 3.2.4: ```ruby @@ -120,9 +126,22 @@ source of thread contention. You must add `gem 'connection_pool'` to your Gemfile and add :pool\_size to your `dalli_store` config: ```ruby config.cache_store = :dalli_store, 'cache-1.example.com', { :pool_size => 5 } +``` + +You can then use the Rails cache as normal or check out a Dalli client directly from the pool: + +```ruby +Rails.cache.fetch('foo', :expires_in => 300) do + 'bar' +end + +Rails.cache.dalli.with do |client| + # client is a Dalli::Client instance which you can + # use ONLY within this block +end ``` Configuration ------------------------