Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

CacheRecord
===========
An easy to use and lightweight library to cache ActiveRecord objects using a caching system like MemCache.
Example
=======
Caching lookups using finders
-----------------------------
class User < ActiveRecord::Base
cache_record_by :id, :user_name
end
This will cause lookups like
User.find_by_id(1) to be cached, so subsequent lookups will not hit the database.
User.find_by_username("tusharr") will also be cached
Caching lookups for singleton class objects
--------------------------------------------
class GlobalSetting < ActiveRecord::Base
def self.instance
first || new
end
cache_record_instance end
All calls to GlobalSetting.instance will be cached and will not hit the database
The plugin handles cache invalidation for cached objects on updates & deletes.
Copyright (c) 2009 Tushar Ranka, released under the MIT license

About

Easily cache activerecord object to a caching system like Memcache

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages