pubkey = $pubkey; $this->npub = $keys->convertPublicKeyToBech32($pubkey); try { $cacheKey = '0_' . $this->pubkey; $this->user = $this->redisCache->get($cacheKey, function (ItemInterface $item) use ($pubkey) { $item->expiresAfter(3600); // 1 hour, adjust as needed $meta = $this->nostrClient->getNpubMetadata($pubkey); return (array) json_decode($meta->content); }); } catch (InvalidArgumentException | \Exception $e) { // nothing to do } } }