Updated cache deletion function