Created
July 27, 2009 09:11
-
-
Save nesquena/156120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For rails, running memcache in development mode | |
# check if memcached is running; if it is, enable caching | |
# To start use $ memcached -m 64 -l 127.0.0.1 -p 11211 -vv -u root | |
begin | |
Timeout.timeout(0.5) { TCPSocket.open("localhost", 11211) { } } | |
config.action_controller.perform_caching = true | |
config.cache_store = :mem_cache_store, "localhost:11211", { :namespace => "quub" } | |
rescue StandardError | |
config.action_controller.perform_caching = false | |
config.cache_store = :file_store, "#{Rails.root}/tmp/cache" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment