public
Description: Transparently caches ActiveResource data in a memcached instance by extending cache_fu
Homepage: http://dougmcinnes.com/2008/10/30/cached_resource/
Clone URL: git://github.com/latimes/cached_resource.git
kangster (author)
Tue Dec 16 13:33:21 -0800 2008
dmcinnes (committer)
Tue Dec 16 17:35:21 -0800 2008
name age message
file MIT-LICENSE Thu Jan 31 09:40:10 -0800 2008 initial import git-svn-id: http://svn.latimesd... [srao]
file README Loading commit data...
file Rakefile
file init.rb
directory lib/
directory test/
README
Cached Resource
===============

Transparently caches ActiveResource data in a memcached instance by extending cache_fu.

Requires cache_fu
http://errtheblog.com/posts/57-kickin-ass-w-cachefu

Configuring the connection to memcache is done through the cache_fu plugin.


Example
=======

This is all you need:

  class MyClass < ActiveResource::Base
    self.site = MY_SITE
    cached_resource
  end


Now every time you run a find it will hit the cache first then do the rest query.  When retrieving collections, 
individual objects in the collection will be cached separately.

The cached_resource call also takes normal cache_fu options:

  cached_resource :ttl => 15.minutes  


Doug McInnes <doug.mcinnes@latimes.com>
Subba Rao

Copyright (c) 2008 Los Angeles Times