[raleigh.rb] Caching AR queries
pelargir at gmail.com
Sat Apr 2 16:50:24 EDT 2011
On Apr 2, 2011, at 4:47 PM, Nathaniel Talbott wrote:
> Rails automatically caches queries for the duration of a request, right?
> Unless the objects you're wanting to cache take a long time to load
> for some reason, I'd be somewhat surprised if caching them for longer
> than a request cycle bought you much in the way of improved
> performance. Have you been able to do any measurements around the time
> to load these objects?
The quirk in this case is that it's not a flat list of objects... it's a tree structure. Each object has a parent and may have children. The tree can only go 3 levels deep, but it makes it challenging to access it in a way that doesn't trigger cascading queries.
I think I may have found a simple way to achieve what I want with Rails.cache
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the raleigh-rb-members