Reenable caching for part provider system.

This commit is contained in:
Jan Böhmer 2023-07-31 22:21:20 +02:00
parent 5750e7dbdf
commit d847b74522

View file

@ -74,10 +74,7 @@ final class PartInfoRetriever
protected function searchInProvider(InfoProviderInterface $provider, string $keyword): array
{
//Generate key and escape reserved characters from the provider id
$escaped_keyword = urlencode($keyword) . uniqid();
dump("Remove the uniqid() from the escaped_part_id variable to use the cache");
$escaped_keyword = urlencode($keyword);
return $this->partInfoCache->get("search_{$provider->getProviderKey()}_{$escaped_keyword}", function (ItemInterface $item) use ($provider, $keyword) {
//Set the expiration time
$item->expiresAfter(self::CACHE_RESULT_EXPIRATION);
@ -98,10 +95,7 @@ final class PartInfoRetriever
$provider = $this->provider_registry->getProviderByKey($provider_key);
//Generate key and escape reserved characters from the provider id
$escaped_part_id = urlencode($part_id) .uniqid();
dump("Remove the uniqid() from the escaped_part_id variable to use the cache");
$escaped_part_id = urlencode($part_id);
return $this->partInfoCache->get("details_{$provider_key}_{$escaped_part_id}", function (ItemInterface $item) use ($provider, $part_id) {
//Set the expiration time
$item->expiresAfter(self::CACHE_DETAIL_EXPIRATION);