Cache invalidation on index page

Hi there,

What’s the simplest way to determine if any item on an index page has changed for caching purposes? For example say we have an index page that lists every Company in the system. I know that when the objects on your index page all belong_to a parent object Rails gives us a nice way to bump the cache key of the parent object when any child changes using touch: true. I have a case though where the objects in the list don’t all belong_to another object. I’m sure there must be a simple way to determine if any item has changed. At first I thought maybe adding Company.maximum(:updated_at) to my cache key would work but that won’t change if there’s a deletion.

Thanks!