From 956d6deded37c0539e73b9cdb4802fcbef6170a9 Mon Sep 17 00:00:00 2001 From: Ophelia Goldstein <159258143+opheliagoldstein@users.noreply.github.com> Date: Wed, 8 Oct 2025 02:12:28 +0300 Subject: [PATCH] feat: disable caching when NODE_ENV is development (#4543) Co-authored-by: Alexandr --- src/common/cache.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/cache.js b/src/common/cache.js index a4e68113..32aa48ce 100644 --- a/src/common/cache.js +++ b/src/common/cache.js @@ -47,7 +47,7 @@ const disableCaching = (res) => { * @param {number} cacheSeconds The cache seconds to set in the headers. */ const setCacheHeaders = (res, cacheSeconds) => { - if (cacheSeconds < 1) { + if (cacheSeconds < 1 || process.env.NODE_ENV === "development") { disableCaching(res); return; } @@ -69,7 +69,10 @@ const setErrorCacheHeaders = (res) => { const envCacheSeconds = process.env.CACHE_SECONDS ? parseInt(process.env.CACHE_SECONDS, 10) : NaN; - if (!isNaN(envCacheSeconds) && envCacheSeconds < 1) { + if ( + (!isNaN(envCacheSeconds) && envCacheSeconds < 1) || + process.env.NODE_ENV === "development" + ) { disableCaching(res); return; }