On Nov 25, 2011, at 11:26 PM, Andrew Brown wrote:

> This looks like the right path I need to go down.  Might I add an
> additional resource that helps with the caching needs:
> http://guides.rubyonrails.org/caching_with_rails.html
> 
> However, I have another question about how the caching actually
> works.  Does it cache the html output of the fragment it surrounds and
> just serve that up to anyone who requests that fragment each time?  If
> so, is it possible to cache an ActiveRecord object and then render it
> in a different way depending on the user who is currently logged in?
> For instance, every user would key off the same cached copy of the
> result (until the row changed) but it would be rendered differently
> depending on various conditions.  Can Rails' caching accomplish
> something like this?

Yes. Read the Rails Guide on caching, there's a section labeled Action Caching, 
which can do what you want.

Walter

> 
> On Nov 25, 10:57 am, "Jeffrey L. Taylor" <[email protected]>
> wrote:
>> Quoting Andrew Brown <[email protected]>:
>> 
>>> I have a few questions about how well RoR performs under various
>>> 'irregular' circumstances.  First, how quickly does rails work when
>>> there are potentially lots of embedded ruby expressions (hundreds) per
>>> page?  Also, how well does ruby do when there are perhaps hundreds of
>>> database reads per page?
>> 
>> Use fragment caching so messages are rendered only when they change.  See
>> Railscasts #90,http://railscasts.com/episodes/90-fragment-caching
>> 
>> HTH,
>>   Jeffrey
> 
> -- 
> 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to