README.md in dalli-2.0.3 vs README.md in dalli-2.0.4
- old
+ new
@@ -84,44 +84,15 @@
To use Dalli for Rails session storage, in `config/initializers/session_store.rb`:
require 'action_dispatch/middleware/session/dalli_store'
Rails.application.config.session_store :dalli_store, :memcache_server => ['host1', 'host2'], :namespace => 'sessions', :key => '_foundation_session', :expire_after => 30.minutes
+Both cache and session stores support `:raise_errors` parameter, which propagates exceptions (e.g. if all memcache servers are down) instead of silently hiding errors.
+
Dalli does not support Rails 2.x any longer.
-Usage with Passenger
-------------------------
-
-Put this at the bottom of `config/environment.rb`:
-
- if defined?(PhusionPassenger)
- PhusionPassenger.on_event(:starting_worker_process) do |forked|
- # Reset Rails's object cache
- # Only works with DalliStore
- Rails.cache.reset if forked
-
- # Reset Rails's session store
- # If you know a cleaner way to find the session store instance, please let me know
- ObjectSpace.each_object(ActionDispatch::Session::DalliStore) { |obj| obj.reset }
- end
- end
-
-Usage with Unicorn
------------------------
-
-Modify the `after_fork` block in your unicorn config file:
-
- after\_fork do |server, worker|
- Rails.cache.reset if Rails.cache.respond_to?(:reset)
-
- # Reset Rails's session store
- # If you know a cleaner way to find the session store instance, please let me know
- ObjectSpace.each_object(ActionDispatch::Session::DalliStore) { |obj| obj.reset }
- end
-
-
Configuration
------------------------
Dalli::Client accepts the following options. All times are in seconds.
**expires_in**: Global default for key TTL. No default.
@@ -148,9 +119,13 @@
Features and Changes
------------------------
By default, Dalli is thread-safe. Disable thread-safety at your own peril.
+
+Dalli does not need anything special in Unicorn/Passenger since 2.0.4.
+It will detect sockets shared with child processes and gracefully reopen the
+socket.
Note that Dalli does not require ActiveSupport or Rails. You can safely use it in your own Ruby projects.
Helping Out