From d087318286a32a82eb5bb211fad8aba0eeba257e Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 12 Sep 2025 18:24:19 +0000 Subject: [PATCH] chore(fetcher): cache only 2xx and 404 responses --- src/utils/Fetcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index a181b87..89936a9 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -195,11 +195,11 @@ export class Fetcher { } private determineCacheTtl(status: number, policy: CachePolicy, init?: CustomRequestInit): number { - if (status === 200 || status === 404) { + if ((status >= 200 && status <= 299) || status === 404) { return Math.max(policy.timeToLive(), init?.minCacheTtl ?? this.MIN_CACHE_TTL); } - return policy.timeToLive(); + return 0; }; private async cacheGet(key: string): Promise {