Disable caching for config.json file (#421)
* Disable caching for config.json file * Disable cache when fetching config.json
This commit is contained in:
parent
3b6fda4fa5
commit
3fd014ddad
|
@ -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();
|
||||
|
|
14
web.config
14
web.config
|
@ -42,6 +42,13 @@
|
|||
</staticContent>
|
||||
</system.webServer>
|
||||
</location>
|
||||
<location path="config.json">
|
||||
<system.webServer>
|
||||
<staticContent>
|
||||
<clientCache cacheControlMode="DisableCache" />
|
||||
</staticContent>
|
||||
</system.webServer>
|
||||
</location>
|
||||
<location path="mpac/explorer.html">
|
||||
<system.webServer>
|
||||
<staticContent>
|
||||
|
@ -56,4 +63,11 @@
|
|||
</staticContent>
|
||||
</system.webServer>
|
||||
</location>
|
||||
<location path="mpac/config.json">
|
||||
<system.webServer>
|
||||
<staticContent>
|
||||
<clientCache cacheControlMode="DisableCache" />
|
||||
</staticContent>
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
Loading…
Reference in New Issue