From de9a0d65aed4f5c4aebde9bfbc0c7c657f484b55 Mon Sep 17 00:00:00 2001 From: CalciumIon <1808837298@qq.com> Date: Wed, 4 Dec 2024 20:51:55 +0800 Subject: [PATCH] feat: add Cache-Control header to API requests --- web/src/helpers/api.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/helpers/api.js b/web/src/helpers/api.js index 67f3e3c4..635d63b8 100644 --- a/web/src/helpers/api.js +++ b/web/src/helpers/api.js @@ -6,7 +6,8 @@ export let API = axios.create({ ? import.meta.env.VITE_REACT_APP_SERVER_URL : '', headers: { - 'New-API-User': getUserIdFromLocalStorage() + 'New-API-User': getUserIdFromLocalStorage(), + 'Cache-Control': 'no-store' } }); @@ -16,7 +17,8 @@ export function updateAPI() { ? import.meta.env.VITE_REACT_APP_SERVER_URL : '', headers: { - 'New-API-User': getUserIdFromLocalStorage() + 'New-API-User': getUserIdFromLocalStorage(), + 'Cache-Control': 'no-store' } }); }