Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated README with instructions for usage with Unicorn.

  • Loading branch information...
commit ffbbbbb18c45f4deb1b6e8b4fb7c2e1595093b60 1 parent 669bd18
Mike Desjardins authored
Showing with 24 additions and 0 deletions.
  1. +24 0 README.md
24 README.md
View
@@ -107,6 +107,30 @@ Put this at the bottom of `config/environment.rb`:
end
+Usage with Unicorn
+------------------------
+
+Modify the after_fork block in your unicorn config file:
+
+ after_fork do |server, worker|
+ #
+ # Added the following code for Dalli
+ #
+ if defined?(ActiveSupport::Cache::DalliStore) && Rails.cache.is_a?(ActiveSupport::Cache::DalliStore)
+ # Reset Rails's object cache
+ # Only works with DalliStore
+ Rails.cache.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
+ #
+ # End of modifications for Dalli
+ #
+ end
+
+
Configuration
------------------------
Dalli::Client accepts the following options. All times are in seconds.
Please sign in to comment.
Something went wrong with that request. Please try again.