From 6afca44897b2cc7a9eab442fdb12cd0f00a0269e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 15 Feb 2026 22:19:44 +0100 Subject: [PATCH] Use xxh3 hashes instead of encoding for info provider cache keys --- src/Services/InfoProviderSystem/PartInfoRetriever.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Services/InfoProviderSystem/PartInfoRetriever.php b/src/Services/InfoProviderSystem/PartInfoRetriever.php index 0eb74642..9a24f3ae 100644 --- a/src/Services/InfoProviderSystem/PartInfoRetriever.php +++ b/src/Services/InfoProviderSystem/PartInfoRetriever.php @@ -82,7 +82,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); + $escaped_keyword = hash('xxh3', $keyword); return $this->partInfoCache->get("search_{$provider->getProviderKey()}_{$escaped_keyword}", function (ItemInterface $item) use ($provider, $keyword) { //Set the expiration time $item->expiresAfter(!$this->debugMode ? self::CACHE_RESULT_EXPIRATION : 1); @@ -108,7 +108,7 @@ final class PartInfoRetriever } //Generate key and escape reserved characters from the provider id - $escaped_part_id = urlencode($part_id); + $escaped_part_id = hash('xxh3', $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(!$this->debugMode ? self::CACHE_DETAIL_EXPIRATION : 1); @@ -145,4 +145,4 @@ final class PartInfoRetriever return $this->dto_to_entity_converter->convertPart($details); } -} \ No newline at end of file +}