Friday, November 25, 2011

[Rails] Re: Lots of embedded ruby / database queries on a page

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?

On Nov 25, 10:57 am, "Jeffrey L. Taylor" <r...@abluz.dyndns.org>
wrote:
> Quoting Andrew Brown <andrewrbro...@gmail.com>:
>
> > 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate