Cache invalidation by entity.

#6043