Joined May 2014
·
Posted to
Cache your partials, not the other way around.
over 1 year
ago
I'd love your feedback on this: https://github.com/joshblour/jbuilder_cache_multi
it uses fetch_multi in rails 4 to read all keys at once from the cache.
At first I was doing it the first way you described, then the second way, then I wrote this plugin to make it even faster.
Achievements
28 Karma
0 Total ProTip Views
Charity
Fork and commit to someone's open source project in need
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Mongoose
Have at least one original repo where Ruby is the dominant language
It does! The thing is that Rails 3 doesn't give you a fetch_multi method, so it's up to whichever cache you are using to implement it. If the method doesn't exist, the gem will fall back on iterating over the collection (the second way you describe) so it becomes more of a convenience method than anything else :)