improvements to caching in discovery client