Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Transparently caches ActiveResource data in a memcached instance by extending cache_fu

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
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
Something went wrong with that request. Please try again.