DEV Community

Discussion on: What's the best way to render specific items from a Rails collection?

Collapse
zimski profile image
CHADDA Chakib

Hey
I think in your case, theses pages are perfect to be cached, so don't bother yourself with over-engineering the fetching part.

Even the list will change not often so you can mess with your sql server.

You can do one sql request for each product (N+1), it's not an issue because to result will be cached.

This will help you to ship code fast and the cache will make it fast too