Skip to content

Cache Duration should be defined in Seconds for Laravel 5.8+ #169

Closed
@bcwaretx

Description

@bcwaretx

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

  1. configure Redis caching per documentation
  2. in Geocoder.php config, set cache.duration = 15 (minutes per documentation)
  3. clear Redis cache (no keys present)
  4. execute a geocode() call, verify Redis shows 1 key
  5. execute same geocode(), verify Redis shows a cache hit
  6. Wait 20 seconds, verify Redis shows 0 keys
  7. 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions