views:

43

answers:

1

I read a few tutorials on getting memcached set up with Rails (2.3.5), and I'm a bit lost.

Here's what I need to cache: I have user-specific settings that are stored in the db. The settings are queried in the ApplicationController meaning that a query is running per-request.

I understand that Rails has built-in support for SQL cacheing, however the cacheing only lasts for the duration of an Action.

I want an easy way to persist the settings (which are also ActiveRecord models) for an arbitrary amount of time. Bonus points if I can also easily reset the cache anytime a setting changes.

thanks

+2  A: 

Gregg Pollack of RailsEnvy did a series of "Scaling Rails" screencasts a while back, which are now free (thanks to sponsorship by NewRelic). You might want to start with episode 1, but episode 8 covers memcached specifically:

http://railslab.newrelic.com/2009/02/19/episode-8-memcached

Jeremy Weiskotten