Cache::remember -1 = infinite

This commit is contained in:
slawkens
2025-10-02 22:13:15 +02:00
parent 97f9d3d6f6
commit 64acf70d38

View File

@@ -115,6 +115,11 @@ class Cache
return unserialize($value);
}
// -1 for infinite cache
if ($ttl == -1) {
$ttl = 10 * 365 * 24 * 60 * 60; // 10 years should be enough
}
$value = $callback();
$cache->set($key, serialize($value), $ttl);
return $value;