-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Description
The put interface for the CacheRepository allows to give minutes (as int) or a DataTime object to define the expiry of the cache item. When giving a DateTime object (e.g. using Carbon), which is less than 1 minute in the future, the cache entry will (unexpectedly) not be done, since the timestamp is transformed to "minutes in the future" again and 0 is considered null, which leads to skipping the write operation.
There was a report (#2954) on a similar issue a while ago (in Laravel 4), which was marked as "fixed".
I understand the API does define "int" and by that describe that smaller values are not usable - but in parallel a DateTime object is allowed and there is no documentation stating that small expiration are not unsupported. Caching for a small amount of time and not caching at all can make a large difference.