From a74189b2870f6839d0590fd81cdaa61b17bc904d Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 9 Feb 2024 14:19:56 -0500 Subject: [PATCH] Fix cache invalidation with compression enabled --- src/utils/redis.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/redis.ts b/src/utils/redis.ts index e4d434f..c416146 100644 --- a/src/utils/redis.ts +++ b/src/utils/redis.ts @@ -365,7 +365,9 @@ async function setupCacheClientListener(cacheClient: RedisClientType, if (keys) { lastInvalidationMessage = Date.now(); - for (const key of keys) { + for (let key of keys) { + if (config.redis.useCompression) key = key.replace(/.c$/, ""); + if (cache.delete(key)) { lastInvalidation = Date.now(); }