From ffb02a8866d7e58a1ef0c8bc449082710063f9b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 13:37:23 +0000 Subject: [PATCH] docs: Add comment explaining why conditional headers are skipped when override is true Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com> --- src/interceptors/request.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/interceptors/request.ts b/src/interceptors/request.ts index 8046252..6884b36 100644 --- a/src/interceptors/request.ts +++ b/src/interceptors/request.ts @@ -182,6 +182,9 @@ export function defaultRequestInterceptor(axios: AxiosCacheInstance): RequestInt config ); + // Skip adding conditional headers (If-None-Match, If-Modified-Since) when override is true. + // The override option is meant to bypass cache and get fresh data, not revalidate existing cache. + // Adding conditional headers would cause the server to return 304 Not Modified instead of fresh data. if ((cache.state === 'stale' || cache.state === 'must-revalidate') && !overrideCache) { updateStaleRequest(cache, config as ConfigWithCache);