Re: Object caching

Rick Olson
Fri, 17 Aug 2007 23:37:36 -0000

On 8/17/07, javier ramirez
<jramirez-7iWCczGtl7hBDgjK7y7TUQ@public.gmane.org>
wrote:
>
> Hi again,
>
> Sorry about that, but my prior email was completely messed up. I really
> don''t know how i got the idea of a per-model last query cache
(maybe an
> old rails version? not sure of that), but truth is AR doesn''t
cache like
> that.
>
> There is a cache for the associations, so if you have a variable with a,
> for example, has_many and you call on the association, only the first
> time you use it is the query to be launched.
>
> Sorry once again about the misleading,

Actually, Active Record on edge rails does some caching for DB
queries.  It''s nothing sophisticated, but it helps out a lot.  I wrote
an article comparing the different approaches in AR that you can use
(piggy backing, eager includes, query caching, and an object caching
approach in a plugin I wrote)

http://activereload.net/2007/5/23/spend-less-time-in-the-database-and-more-time-outdoors

--
Rick Olson