From 0ff9e49d00ce74c816f0effa7387f1f32eaee64a Mon Sep 17 00:00:00 2001 From: Work Date: Tue, 29 Sep 2026 15:22:39 -0500 Subject: [PATCH] perf(api): parallelize Redis cache reads Fetch the stream value and its type metadata concurrently to reduce cache-read latency by one Redis round trip. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- api/src/store/redis-store.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/src/store/redis-store.js b/api/src/store/redis-store.js index 0b359526..f0064e3b 100644 --- a/api/src/store/redis-store.js +++ b/api/src/store/redis-store.js @@ -26,11 +26,14 @@ export default class RedisStore extends Store { async _get(key) { await this.#connected; - const valueType = await this.#client.get(this.#keyOf(key) + '_t'); - const value = await this.#client.get( - commandOptions({ returnBuffers: true }), - this.#keyOf(key) - ); + const redisKey = this.#keyOf(key); + const [valueType, value] = await Promise.all([ + this.#client.get(redisKey + '_t'), + this.#client.get( + commandOptions({ returnBuffers: true }), + redisKey + ) + ]); if (!value) { return null;