diff --git a/lib/private/Collaboration/Reference/ReferenceManager.php b/lib/private/Collaboration/Reference/ReferenceManager.php index 9287b66b2a230..737691d85bdb3 100644 --- a/lib/private/Collaboration/Reference/ReferenceManager.php +++ b/lib/private/Collaboration/Reference/ReferenceManager.php @@ -108,11 +108,14 @@ public function resolveReference(string $referenceId, bool $public = false, $sha } if ($reference) { $cachePrefix = $matchedProvider->getCachePrefix($referenceId); + // Respect provider's custom cache TTL, fallback to default if not specified + $cacheTtl = method_exists($matchedProvider, 'getCacheTTL') ? $matchedProvider->getCacheTTL() : self::CACHE_TTL; + $cacheTtl = $cacheTtl ?? self::CACHE_TTL; if ($cachePrefix !== '') { // If a prefix is used we set an additional key to know when we need to delete by prefix during invalidateCache() - $this->cache->set('hasPrefix-' . md5($cachePrefix), true, self::CACHE_TTL); + $this->cache->set('hasPrefix-' . md5($cachePrefix), true, $cacheTtl); } - $this->cache->set($cacheKey, Reference::toCache($reference), self::CACHE_TTL); + $this->cache->set($cacheKey, Reference::toCache($reference), $cacheTtl); return $reference; }