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.


gem install mongocached

Or with Bundler:

source :rubygems
gem 'mongocached'

Basic Usage

$cache =

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

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

# block stlye
$'key') do


Published on in Ruby