3 ms·
You hit the DB for the top-level. So in step 6, we'll always hit the db for the latest project, but we will not hit the db for the todolists or the todos of tho
by dhh 15y ago
You hit the DB for the top-level. So in step 6, we'll always hit the db for the latest project, but we will not hit the db for the todolists or the todos of those todolists if the project cache is fresh.
So you save the render plus any db calls that would be triggered as part of that render.
- hasenj 15y agoSo simple yet so brilliant! I can't believe I didn't think of this before. My initial reaction after I skimmed the post was "uhh, so you still hit the db? what's the point?" Thanks for sharing this! I definitely want to implement something similar for my future projects!