Invalidate cache if redefined or removed