Caches RB plugin

Plugin details

Caches.rb is a simple Ruby library that allows you to let some class methods be cached.

Websitehttp://pad.verbdev.com/cachesrb/ Repositorysvn://verbdev.com/rubylibs/caches.rb/trunk Author Yurii Rashkovskii Tags Cache LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install svn://verbdev.com/rubylibs/caches.rb/trunk

Now Caches.rb makes use of some kind of pluggable storages, which makes it pretty simple to use different storage techniques. What for? The primary intention is to support database-wide ActiveRecord model method caching. All models of the same class and the same ID will share the same caches.

  >> article = Article.find(1)
  >> article.expensive_method
 => some work + result
  >> article.expensive_method
 => cached result
  >> Article.find(1).expensive_method
 => cached result



As far as I remember, #find has started caching model instance in Rails recently, so there is less value in my today’s Caches.rb improvement. Though I’m sure it makes some sense. At least it was interesting for me to play with it.

You can try out new caches.rb by getting its trunk (rev >= 49). Warning: it’s a very early code, use it with caution. If you’re not sure you want to have some experimental code inside your app, please stick with rev48 or so.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago