ActiveSupport::Cache and CloudCache

1 view
Skip to first unread message

Marc

unread,
Oct 1, 2009, 6:20:41 PM10/1/09
to CloudCache.ws
If you've already been using ActiveSupport::Cache in your Ruby on
Rails app, then you'll only need to change one line to use CloudCache:
config.cache_store = CloudCache.new(CC_ACCESS_KEY, CC_SECRET_KEY)

However if you're looking for places in your code to cache, here are
some great resources:
* http://thewebfellas.com/blog/2008/6/9/rails-2-1-now-with-better-integrated-caching
* Caching Fragments - http://api.rubyonrails.org/classes/ActionController/Caching/Fragments.html
* General caching - http://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html
* What to cache - http://guides.rubyonrails.org/caching_with_rails.html

Counters are another area where CloudCache is your friend - writing to
the db every time your page gets a view for example is a sure way to
limit your scale. The incr (and decr) functions on CloudCache, on the
other hand, are capable of handling very large scale. That's because
incr (and decr) are atomic operations, guaranteed to be tolerant of
race conditions no matter how large your scale.

Keep an eye out for an upcoming note on how to leverage CloudCache for
view counting.

Cheers,


Marc

Reply all
Reply to author
Forward
0 new messages