Project

riak-cache

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
riak-cache is an ActiveSupport::Cache::Store that is backed by Riak. It supports ActiveSupport version 3.x.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 2.8.0

Runtime

 Project Readme

Rails/ActiveSupport Cache Store for Riak (riak-cache) Build Status

riak-cache is an implementation of ActiveSupport::Cache::Store that stores cached values in Riak. This is especially useful if you have configured Riak to use an in-memory backend.

Dependencies

riak-cache requires ActiveSupport version 3.x for its parent class, and riak-client to connect to Riak.

Development dependencies are handled with bundler. Install bundler (gem install bundler) and run this command:

$ bundle install

To pin to a specific version of ActiveSupport (rather than the latest 3.x version), specify the BUNDLE_GEMFILE environment variable:

$ BUNDLE_GEMFILE=Gemfile.rails31 bundle install

Configuring and Using

To use riak-cache with your Rails project, include it in your project's Gemfile and set it as the cache store inside your config/application.rb like so:

config.cache_store = :riak_store

To provide extra configuration (for example, which Riak nodes to connect to), use an array:

config.cache_store = [:riak_store, {:http_port => 10000}]

Otherwise, you can simply instantiate and use the class wherever you like:

cache = Riak::CacheStore.new
cache.fetch('pages/1234') { render_page }

License & Copyright

Copyright ©2010-2012 Sean Cribbs and Basho Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.