Mongocached: Simple Cache using Mongodb

I created Mongocached, with help from Hector Virgen, as a simple shared cacheing layer for things like html fragments and database calls as a follow up to Diskcached. It specifically targets situations where you want to cache large amounts of data and have memory constraints.

Installation

gem install mongocached

Or with Bundler:

source :rubygems
gem 'mongocached'

Basic Usage

$cache = Mongocached.new()

# with auth
# $cache = Mongocached.new({ username: 'uname', password: 'pword' })

# memcached style
$cache.set('key', 'data')
$cache.get('key')

# block stlye
$cache.save('key') do
  'data'
end

Links

Published on in Ruby