diff --git a/config/nginx.conf b/config/nginx.conf index f3f8140e..e6f6e6be 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -8,7 +8,7 @@ server { location / { try_files $uri $uri/ /index.html; - add_header Cache-Control "no-store, no-cache, must-revalidate"; + add_header Cache-Control "public, max-age=30, stale-while-revalidate=30"; } # assets can be cached because they have hashed filenames diff --git a/public/index.html b/public/index.html index df1edfd9..e14d79be 100644 --- a/public/index.html +++ b/public/index.html @@ -3,6 +3,7 @@
+ { - internalInstance.config = merge({}, DEFAULT_CONFIG, config); - }); + Config.internalInstance.initPromise = downloadConfig("/config.json").then( + (config) => { + internalInstance.config = merge({}, DEFAULT_CONFIG, config); + }, + ); } return Config.internalInstance.initPromise; } @@ -74,11 +74,7 @@ async function downloadConfig( configJsonFilename: string, ): Promise