From 2a7aa2b5c12e106ea8210f0c478644eb12672f48 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 9 Jan 2023 16:40:35 -0600 Subject: [PATCH] Updates to defaults of cache.control setting and enhanced comments --- config/config.example.yml | 8 ++++++-- src/config/default-app-config.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index ec1087525c..27155f74c1 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -32,8 +32,12 @@ cache: # NOTE: how long should objects be cached for by default msToLive: default: 900000 # 15 minutes - # Cache-Control HTTP Header - control: max-age=60 # revalidate browser + # Default 'Cache-Control' HTTP Header to set for all static content (including compiled *.js files) + # Defaults to max-age=604,800 seconds (one week). This lets a user's browser know that it can cache these + # files for one week, after which they will be "stale" and need to be redownloaded. + # NOTE: When updates are made to compiled *.js files, it will automatically bypass this browser cache, because + # all compiled *.js files include a unique hash in their name which updates when content is modified. + control: max-age=604800 # revalidate browser autoSync: defaultTime: 0 maxBufferSize: 100 diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 516d0eca2e..a1ac29e8de 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -68,7 +68,7 @@ export class DefaultAppConfig implements AppConfig { default: 15 * 60 * 1000 // 15 minutes }, // Cache-Control HTTP Header - control: 'max-age=60', // revalidate browser + control: 'max-age=604800', // revalidate browser autoSync: { defaultTime: 0, maxBufferSize: 100,