From 3fd014ddadc2f4221ed8e9c6256c0543d503aaff Mon Sep 17 00:00:00 2001 From: Tanuj Mittal Date: Thu, 4 Feb 2021 15:25:13 +0530 Subject: [PATCH] Disable caching for config.json file (#421) * Disable caching for config.json file * Disable cache when fetching config.json --- src/ConfigContext.ts | 6 +++++- web.config | 22 ++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/ConfigContext.ts b/src/ConfigContext.ts index 39bf29003..66cc14d00 100644 --- a/src/ConfigContext.ts +++ b/src/ConfigContext.ts @@ -80,7 +80,11 @@ if (process.env.NODE_ENV === "development") { export async function initializeConfiguration(): Promise { try { - const response = await fetch("./config.json"); + const response = await fetch("./config.json", { + headers: { + "If-None-Match": "", // disable client side cache + }, + }); if (response.status === 200) { try { const { allowedParentFrameOrigins, ...externalConfig } = await response.json(); diff --git a/web.config b/web.config index 599176261..51421bfe9 100644 --- a/web.config +++ b/web.config @@ -34,26 +34,40 @@ - + - + + + + + + + + - + - + + + + + + + + \ No newline at end of file