[13.x] Pipeline tagged Redis cache reads
RedisTaggedCache::many() currently issues a separate GET for each key. This also affects tagged flexible() reads, which retrieve the cached value and its creation timestamp separately.
This pipelines the individual GETs on standalone Predis and PhpRedis connections. Each command still addresses a single key, so the batch works when a single endpoint enforces Redis Cluster slots. Cluster-aware connections keep their existing per-key reads.
Validation
-
Tested against Redis 8.0.6 with Predis 3.7.0 and PhpRedis 6.2.0. A TCP probe confirmed the round-trip counts for both clients. Median latency comes from five runs of 1,000 warm operations per scenario over loopback.
Workload Round trips Predis p50 PhpRedis p50 Eight-key tagged many()8 → 1 273 → 82 µs 200 → 52 µs Warm tagged flexible()2 → 1 63 → 45 µs 56 → 31 µs Eight-key many()plus nine warmflexible()calls26 → 10 876 → 529 µs 817 → 373 µs -
Both clients returned the expected values for same-slot and cross-slot reads on a three-node Redis Cluster and through a standalone connection to a single node enforcing cluster slots. Warm
flexible()entries did not invoke the refresh callback. -
Focused cache tests passed with 19 tests and 48 assertions. Pint and
git diff --checkpassed.