>> My question then, is does MyOtherModel.find( :all ) still get
executed, >> because the action bar() must still be execute to generate @list?
Yes ... The fragment cache is a part of the view - the action knows
nothing about it directly
>> If so, what would be the benefit of a fragment cache of the @tmp
rendering?
The main benefit of the fragment cache [as I understand it] is to reuse
the rendering cpu cycles where only a part of the action/view is
cacheable due to changing data or security considerations.
In fact, I have ''pushed'' a find or two from my actions into
the view so
that they are also ''cached''. I know it sounds bad, but
performance wise
it was worth it.
Nev
-----Original Message-----
From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On
Behalf Of Belorion
Sent: Sunday, 26 June 2005 5:08 AM
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails] Fragment Caching, again
We have our controller FooController, with action bar().
def bar
@list = MyModel.find( :all )
@tmp = MyOtherModel.find( :all )
end
In my view, I am doing a fragment cache of the segment which uses @tmp,
but not @list.
My question then, is does MyOtherModel.find( :all ) still get executed,
because the action bar() must still be execute to generate @list? If
so, what would be the benefit of a fragment cache of the @tmp rendering?
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails