Merge pull request #6437 from pixelfed/shleeable-patch-21

Update FetchCacheService.php - Cache put/get keys.
pull/6441/head
dansup 3 weeks ago committed by GitHub
commit 7a17a6735a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -18,7 +18,7 @@ class FetchCacheService
$ar = $allowRedirects ? 'ar1:' : 'ar0';
$key = self::CACHE_KEY.sha1($url).':'.$vc.$ar.$ttl;
if (Cache::has($key)) {
return false;
return Cache::get($key);
}
if ($verifyCheck) {
@ -70,10 +70,11 @@ class FetchCacheService
if (! $res->ok()) {
Cache::put($key, 1, $ttl);
return false;
}
return $res->json();
$result = $res->json();
Cache::put($key, $result, $ttl);
return $result;
}
}

Loading…
Cancel
Save