Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (19 sloc) 770 Bytes
Cached Resource
Transparently caches ActiveResource data in a memcached instance by extending cache_fu.
Requires cache_fu
Configuring the connection to memcache is done through the cache_fu plugin.
This is all you need:
class MyClass < ActiveResource::Base = MY_SITE
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 <>
Subba Rao
Copyright (c) 2008 Los Angeles Times