Optimization of a local cache before making a network call