Skip to content
Sign up
Sign in
This repository
Explore
Features
Enterprise
Blog
Star
1
Fork
245
mdesjardins
/
dalli
forked from
mperham/dalli
Code
Pull Requests
Pulse
Graphs
HTTPS
clone URL
Subversion
checkout URL
You can clone with
HTTPS
or
Subversion
.
Download ZIP
Permalink
Browse code
Updated README with instructions for usage with Unicorn.
Loading branch information
...
commit
ffbbbbb18c45f4deb1b6e8b4fb7c2e1595093b60
1 parent
669bd18
mdesjardins
authored
Apr 6, 2012
Unified
Split
Showing
1 changed file
with
24 additions
and
0 deletions
.
+
24
−
0
README.md
24
README.md
Show notes
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.
Toggle all file notes
Please
sign in
to comment.
Something went wrong with that request. Please try again.