3 ms·
Excellent. You may wish to mention that the default Rails.cache is a per-process cache and doesn't work between instances / goes away at process death. For Me
by wavesplash 14y ago
Excellent. You may wish to mention that the default Rails.cache is a per-process cache and doesn't work between instances / goes away at process death.
For Memcache users, configure Rails.cache to use Rails' built in :memcache_store:
http://api.rubyonrails.org/classes/ActiveSupport/Cache/MemCacheStore.html http://api.rubyonrails.org/classes/ActiveSupport/Cache/MemCa...
For Redis fans, try :redis_store:
https://github.com/jodosha/redis-store https://github.com/jodosha/redis-store
This covers Rails 3 caching pretty well:
http://broadcastingadam.com/2011/05/advanced_caching_in_rails http://broadcastingadam.com/2011/05/advanced_caching_in_rail...
Note for Rails 2: If I recall correctly, in Rails 2 fragment caching/action caching still uses the filesystem even if you have a cache_store set.
- robotmay 14y agoAye, I was going on the assumption that people were using memcached/redis. I'll add a little section in case anyone wasn't sure about that bit :)
- pselbert 14y agoAs a small addendum, I strongly recommend dalli (https://github.com/mperham/dalli https://github.com/mperham/dalli) over the default memcached library. It is written by the former maintainer of the memcached gem, is smaller in size, up to 20% faster, and most importantly to me, is actively maintained. Most of that info is in the readme, btw.