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> {
|
export async function initializeConfiguration(): Promise<ConfigContext> {
|
||||||
try {
|
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) {
|
if (response.status === 200) {
|
||||||
try {
|
try {
|
||||||
const { allowedParentFrameOrigins, ...externalConfig } = await response.json();
|
const { allowedParentFrameOrigins, ...externalConfig } = await response.json();
|
||||||
|
|
22
web.config
22
web.config
|
@ -34,26 +34,40 @@
|
||||||
<clientCache cacheControlMode="DisableCache" />
|
<clientCache cacheControlMode="DisableCache" />
|
||||||
</staticContent>
|
</staticContent>
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</location>
|
</location>
|
||||||
<location path="hostedExplorer.html">
|
<location path="hostedExplorer.html">
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<staticContent>
|
<staticContent>
|
||||||
<clientCache cacheControlMode="DisableCache" />
|
<clientCache cacheControlMode="DisableCache" />
|
||||||
</staticContent>
|
</staticContent>
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</location>
|
</location>
|
||||||
|
<location path="config.json">
|
||||||
|
<system.webServer>
|
||||||
|
<staticContent>
|
||||||
|
<clientCache cacheControlMode="DisableCache" />
|
||||||
|
</staticContent>
|
||||||
|
</system.webServer>
|
||||||
|
</location>
|
||||||
<location path="mpac/explorer.html">
|
<location path="mpac/explorer.html">
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<staticContent>
|
<staticContent>
|
||||||
<clientCache cacheControlMode="DisableCache" />
|
<clientCache cacheControlMode="DisableCache" />
|
||||||
</staticContent>
|
</staticContent>
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</location>
|
</location>
|
||||||
<location path="mpac/hostedExplorer.html">
|
<location path="mpac/hostedExplorer.html">
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<staticContent>
|
<staticContent>
|
||||||
<clientCache cacheControlMode="DisableCache" />
|
<clientCache cacheControlMode="DisableCache" />
|
||||||
</staticContent>
|
</staticContent>
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
</location>
|
</location>
|
||||||
|
<location path="mpac/config.json">
|
||||||
|
<system.webServer>
|
||||||
|
<staticContent>
|
||||||
|
<clientCache cacheControlMode="DisableCache" />
|
||||||
|
</staticContent>
|
||||||
|
</system.webServer>
|
||||||
|
</location>
|
||||||
</configuration>
|
</configuration>
|
Loading…
Reference in New Issue