From 58eec3db2cc7c514f5fe968e1668b6f11df5ed99 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:18:45 +0000 Subject: [PATCH] Serve "Cache-Control: no-cache" for non-bundled files. (#20489) Most of the application is built into bundles with unique prefixes and can be ignored, but these files should be checked each load. --- nginx/conf.d/default.conf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 04b1e8ac6a..0ae5790374 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -6,11 +6,20 @@ server { root /usr/share/nginx/html; index index.html; - # Set no-cache for the index.html only so that browsers always check for a new copy of Element Web. + # Set no-cache for the version, config and index.html + # so that browsers always check for a new copy of Element Web. + # NB http://your-domain/ and http://your-domain/? are also covered by this + location = /index.html { add_header Cache-Control "no-cache"; } - + location = /version { + add_header Cache-Control "no-cache"; + } + # covers config.json and config.hostname.json requests as it is prefix. + location /config { + add_header Cache-Control "no-cache"; + } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html;