Cache the counts of an associated collection.