No commit activity in last 3 years
No release in over 3 years
Multiple caches configuration for Ruby On Rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0
>= 0

Runtime

~> 4.2
 Project Readme

Build Status

MultiCache::Rails

Multiple caches configuration for Ruby On Rails.

Installation

Add this line to your application's Gemfile:

gem 'multi_cache-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install multi_cache-rails

And then add "require" on 'project_root/config/application.rb'

require 'rails/all'
require 'multi_cache'

Usage

On Application.configure , it's like project_root/config/emvironments/production.rb

YourProject::Application.configure do

config.cache_store =  :dalli_store, 'localhost', { compress: true }
config.cache_store = {
  name: :secondary,
  setting: :memory_store
}
end

Then, In your project, you can use the caches like below,

Rails.cache.read("something") # fetch cached object from :dalli_store
Rails.cache(:secondary).read("something") # fetch cached object from :memory_store

Contributing

  1. Fork it ( https://github.com/[my-github-username]/multicache-rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request