WARNING
This repo is no longer actively maintained. Use at your own discretion
MultiStore allows you to delegate to multiple ActiveSupport cache stores. This makes it easy to implement behaviors such as "cache frequently used things locally, but infrequently used things remotely".
Add an initializer that sets the rails cache, and tier your caches to your heart's content!
stores = [
ActiveSupport::Cache::MemoryStore.new,
ActiveSupport::Cache::FileStore.new('/tmp/cache')
]
ActionController::Base.cache_store = :multi_store, stores
Rails.cache = ActionController::Base.cache_store
Add this line to your application's Gemfile:
gem 'multi_store'
And then execute:
$ bundle
Or install it yourself as:
$ gem install multi_store
Bug reports and pull requests are welcome on GitHub at https://github.com/Gusto/multi_store.