Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/private/Collaboration/Reference/ReferenceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down