Hi all,

What is the best way to store variables strictly for the lifetime of a
Rails' request?

I'm currently storing AR records in Rails.cache. Although this saves a
trip to the DB, I feel it's unnecessary to hit the cache more than once
per request (even when using MemoryStore there are Marshals involved).
Where is the best place to stash any stuff retrieved from the cache? It
doesn't need to (in fact, shouldn't) last past a single request.

An instance variable in ApplicationController sounds like it would do
this, but I would say such data should be kept with the model. Of course
a class variable in the model will keep its value each request (in
production) so is inappropriate for this.

Any ideas?

Shak
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to