Description
General Information
GeocoderLaravel Version: 4.3
Laravel Version: 6.18.1 dev (Since 5.8)
PHP Version: 7.2.5+
Operating System and Version: MacOS 10.11 MAMP Pro 5.5
Issue Description
Beginning with Laravel 5.8, cache TTL is defined in Seconds rather than Minutes. This was identified as a major breaking change:
https://laravel.com/docs/5.8/upgrade#cache-ttl-in-seconds
laravel/framework#27276
Steps to Replicate
- configure Redis caching per documentation
- in Geocoder.php config, set cache.duration = 15 (minutes per documentation)
- clear Redis cache (no keys present)
- execute a geocode() call, verify Redis shows 1 key
- execute same geocode(), verify Redis shows a cache hit
- Wait 20 seconds, verify Redis shows 0 keys
- execute same geocode(), verify Redis key is again added
Stack Trace
n/a
Since the Caching change is a major and documented breaking issue in Laravel, I am not sure if it would be preferred to only make a documentation update in the "Cache Duration" section of the config file, or update the library to convert provided parameter in Minutes into Seconds for the caching calls. Since the latter would potentially introduce a breaking change to applications that have already been modified for Laravel 5.8+, the documentation update may be the best route.
Thanks for a very helpful library