mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Reenable caching for part provider system.
This commit is contained in:
parent
5750e7dbdf
commit
d847b74522
1 changed files with 2 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue