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);