Giter Club home page Giter Club logo

riak-cache's Introduction

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.

riak-cache's People

Contributors

seancribbs avatar

Watchers

patrick jones avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.