0

I'm using Redis cluster using Predis in PHP, I'm doing simple

$image_urls = $client->get($key)

Now I want to get the host address where Redis found the key-value pair because it also contains local images, I need to get the full link of those images.

1 Answers1

1

You can use getConnectionByKey() to get that information.

In example:

$cluster = new PredisCluster();
$cluster->add($connection);
$cluster->add($connection2);
$connection = $cluster->getConnectionByKey($key);

source: PredisClusterTest.php

Mark Berube
  • 206
  • 3
  • 11