New to Rails 3? Check out the Ruby on Rails 3 Tutorial book and screencast.

A book and screencast series showing you how to develop and deploy industrial-strength Rails apps in a direct, step by step way. The screencast series includes 12 lessons over more than 15 hours! Get the best "over the shoulder" experience of following what a top Rails 3 developer does when building an app today. Click here to learn more.

Rails 2.1 Caching Walkthrough

In Tips, Tutorials

Rob Anderton has put together an easy-to-read walkthrough of some of the new caching features in Rails 2.1. One of the coolest new features is that Rails provides an abstraction to using the back-end caching features (whether ultimately provided by file stores or memcached):

# Write a string to the cache
Rails.cache.write('test_key', 'test_value')
=> true
# Read it back in
Rails.cache.read('test_key')
=> 'test_value'
# Delete the item
Rails.cache.delete('test_key')
=> true

Post to Twitter Tweet This Post

Vaguely Related Posts (Usually)

Leave a Reply