diff --git a/src/Internal/Driver/CacheContainer.php b/src/Internal/Driver/CacheContainer.php index 4da2278..1ad4d0d 100644 --- a/src/Internal/Driver/CacheContainer.php +++ b/src/Internal/Driver/CacheContainer.php @@ -81,13 +81,17 @@ final class CacheContainer public function get(string|int $index): mixed { if (isset($this->ttl[$index])) { - $this->ttl[$index] = \time() + $this->cacheTtl; + if ($this->ttl[$index] !== true) { + $this->ttl[$index] = \time() + $this->cacheTtl; + } return $this->cache[$index]; } $result = $this->inner->offsetGet($index); if (isset($this->ttl[$index])) { - $this->ttl[$index] = \time() + $this->cacheTtl; + if ($this->ttl[$index] !== true) { + $this->ttl[$index] = \time() + $this->cacheTtl; + } return $this->cache[$index]; }