fixes #3185 Deleting a relationship does not remove from the cache

Deleting a relationship removes from cache now, fixed and pushed the code for review, please check it.