← Graph

Use touch: true for fragment cache invalidation

takeaway 3 connections

When caching a parent fragment that depends on child records (e.g. reviews of a product), the child's belongs_to must use touch: true so creating/updating a child bumps the parent's updated_at and invalidates the cache. Works well for typical has_many sizes; edge cases with very large collections may warrant removing touch.

type
recommendation
takeaway Use touch: true for fragment cache invalidation
about
Directly about fragment cache key invalidation.
about
Use touch: true for fragment cache invalidation takeaway
Directly challenges the touch recommendation.
takeaway Use touch: true for fragment cache invalidation
from_talk
Shown on the reviews belongs_to product relationship.

Provenance