From 4443484a9127adb2535d0ea6c1dd5ce3ad2647e2 Mon Sep 17 00:00:00 2001 From: Andrii Mavdryk Date: Fri, 10 Nov 2023 17:22:54 +0200 Subject: [PATCH] Fix [API] browser caching --- src/httpClient.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/httpClient.js b/src/httpClient.js index c6ad8906a..20fe8ff22 100755 --- a/src/httpClient.js +++ b/src/httpClient.js @@ -20,10 +20,14 @@ such restriction. import axios from 'axios' import qs from 'qs' +const headers = { + 'Cache-Control': 'no-cache' +} export const mainBaseUrl = `${process.env.PUBLIC_URL}/api/v1` export const mainHttpClient = axios.create({ baseURL: mainBaseUrl, + headers, // serialize a param with an array value as a repeated param, for example: // { label: ['host', 'owner=admin'] } => 'label=host&label=owner%3Dadmin' @@ -31,13 +35,16 @@ export const mainHttpClient = axios.create({ }) export const functionTemplatesHttpClient = axios.create({ - baseURL: `${process.env.PUBLIC_URL}/function-catalog` + baseURL: `${process.env.PUBLIC_URL}/function-catalog`, + headers }) export const nuclioHttpClient = axios.create({ - baseURL: `${process.env.PUBLIC_URL}/nuclio/api` + baseURL: `${process.env.PUBLIC_URL}/nuclio/api`, + headers }) export const iguazioHttpClient = axios.create({ - baseURL: process.env.NODE_ENV === 'production' ? '/api' : '/iguazio/api' + baseURL: process.env.NODE_ENV === 'production' ? '/api' : '/iguazio/api', + headers })