WIP: Cache invalidation by entity.

#6043 
WIP
@amitaibu, I added explanation.