Hi all I just spotted this article, redhanded.hobix.com/inspect/erbCachingInAHandful.html, at RedHanded. It links to some ruby code (segment7.net/projects/ruby/snippets/erb_cache.rb) for caching compiled Erb templates without evaluating them. For situations where you don''t want to cache anything on the page (ie: action/partial/page caching is out), it could be rather useful. In fact, this could be used in every ''production'' environment by default, allowing rails to keep your layouts and views compiled in memory instead of having a disk hit for each of them, and avoiding running them through the compilation process each time. Anyone else think this might be useful? Or, am I way off base? Dave -- Dave Goodlad dgoodlad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org or dave-eHfbeeWWzZOw5LPnMra/2Q@public.gmane.org david.goodlad.ca
On 19.4.2005, at 19:02, David Goodlad wrote:> > Anyone else think this might be useful?+1 //jarkko -- Jarkko Laine jlaine.net odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org lists.rubyonrails.org/mailman/listinfo/rails
> > Anyone else think this might be useful? Or, am I way off base?+1 Steve
Uhh, rails does this. Perhaps Eric''s way is a tad more elegant though. On 4/19/05, Steve V <ruby-ChEX1j9zMF7JbC0vcoRRxNBPR1lH4CV8@public.gmane.org> wrote:> > > > Anyone else think this might be useful? Or, am I way off base? > > +1 > > Steve-- Tobi snowdevil.ca - Snowboards that don''t suck hieraki.org - Open source book authoring blog.leetsoft.com - Technical weblog
> Uhh, rails does this. > > Perhaps Eric''s way is a tad more elegant though.Is it application wide, or is it specific to the current connection? I thought from when I read the code that it was only specific to the current connection, but I may be mistaken. Steve
Tobias Luetke wrote:>Uhh, rails does this. > >No, it doesn''t. But a patch is already pending: dev.rubyonrails.org/ticket/912 -- stefan
On 4/19/05, Stefan Kaes <skaes-hi6Y0CQ0nG0@public.gmane.org> wrote:> Tobias Luetke wrote: > > >Uhh, rails does this. > > > > > No, it doesn''t. But a patch is already pending: > dev.rubyonrails.org/ticket/912 > > -- stefan > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > lists.rubyonrails.org/mailman/listinfo/rails >In the latest trunk version, I see a parameter ActionView#cache_template_loading that if set to true, will cache the compiled ERb files. Sorry for the dupe :) Dave -- Dave Goodlad dgoodlad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org or dave-eHfbeeWWzZOw5LPnMra/2Q@public.gmane.org david.goodlad.ca
David Goodlad wrote:> On 4/19/05, Stefan Kaes <skaes-hi6Y0CQ0nG0@public.gmane.org> wrote: > >>Tobias Luetke wrote: >> >> >>>Uhh, rails does this. >>> >>> >> >>No, it doesn''t. But a patch is already pending: >>dev.rubyonrails.org/ticket/912 >> >>-- stefan >> >>_______________________________________________ >>Rails mailing list >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>lists.rubyonrails.org/mailman/listinfo/rails >> > > > In the latest trunk version, I see a parameter > ActionView#cache_template_loading that if set to true, will cache the > compiled ERb files. Sorry for the dupe :)It will cache the Ruby code, but it will still eval it for every request.