Open
Description
What are you think about add to ProviderCache flag isAllowEmptyResult
?
For example:
$chain = new \Geocoder\Provider\Chain\Chain([
// ...
]);
$cache = new \Geocoder\Provider\Cache\ProviderCache($chain, $cache, 86400);
When have exceptions from providers the chain catch and return empty ArrayCollection.
This result is saved for 24h. I think will be good point if I don't save empty results.
Geocoder/src/Provider/Cache/ProviderCache.php
Lines 65 to 66 in 3565098
Here is example how I think can be:
$result = $this->realProvider->geocodeQuery($query);
if (!$result->isEmpty() || $this->isAllowEmptyResult)) {
$this->cache->set($cacheKey, $result, $this->lifetime);
}
What are you think about it?