WIP: Cache invalidation by entity.

#6043 
WIP
But then it fails when we get it as higher case...