Sha256: cd0fad48937078b5e401612a4a7c00f9549c4016fca1391201fd117fc649bbe5

Contents?: true

Size: 966 Bytes

Versions: 2

Compression:

Stored size: 966 Bytes

Contents

= RecordCache

RecordCache is a simple yet powerful extension to ActiveRecord that caches indexes
and ActiveRecord models using MemCache. If you use it correctly, it will drastically
reduce your database load.

== Usage:

  require 'record_cache'

  class User < ActiveRecord
    record_cache :by => :id
    record_cache :id, :by => :username
  end

  # These will use the cache now.
  User.find(1)
  User.find_by_id(2)
  User.find_all_by_username('chuck')

Invalidation is handled for you using callbacks. Be careful though if you modify records
directly using SQL. Both update_all and delete_all handle invalidations for you, but other
direct SQL will not.

== Install:

  sudo gem install record_cache -s http://gemcutter.org

== Dependencies:

* {after_commit}[http://github.com/freelancing-god/after_commit]
* {memcache}[http://github.com/ninjudd/memcache]

== License:

Copyright (c) 2009 Justin Balthrop, Geni.com; Published under The MIT License, see LICENSE

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
record_cache-0.9.12 README.rdoc
record_cache-0.9.10 README.rdoc