Disable caching for config.json file (#421)

* Disable caching for config.json file

* Disable cache when fetching config.json
This commit is contained in:
Tanuj Mittal
2021-02-04 15:25:13 +05:30
committed by GitHub
parent 3b6fda4fa5
commit 3fd014ddad
2 changed files with 23 additions and 5 deletions

View File

@@ -80,7 +80,11 @@ if (process.env.NODE_ENV === "development") {
export async function initializeConfiguration(): Promise<ConfigContext> {
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();