From e0d56ae4e73526241db565ce8fb741e94366c996 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Wed, 23 Oct 2024 15:31:30 +0200 Subject: [PATCH] 2773: Add no-cache directive --- .../itkdev/etc/confd/templates/default.conf.tmpl | 12 ++++-------- .../os2display/etc/confd/templates/default.conf.tmpl | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl b/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl index 3dea9060..27f75763 100644 --- a/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl +++ b/infrastructure/itkdev/etc/confd/templates/default.conf.tmpl @@ -4,14 +4,14 @@ server { root /var/www/html; index index.html index.htm; + add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; + add_header Pragma "no-cache"; + add_header Expires "0"; + # Any route containing a file extension (e.g. /devicesfile.js) location ~* ^{{ getenv "APP_ADMIN_CLIENT_PATH" "" }}/(.+\..+)$ { rewrite ^{{ getenv "APP_ADMIN_CLIENT_PATH" "/" }}(.*) /$1 break; - add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - add_header Pragma "no-cache"; - add_header Expires "0"; - try_files $uri =404; } @@ -19,10 +19,6 @@ server { rewrite ^{{ getenv "APP_ADMIN_CLIENT_PATH" "/" }}(.*) /$1 break; autoindex off; - add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - add_header Pragma "no-cache"; - add_header Expires "0"; - try_files $uri /index.html; } diff --git a/infrastructure/os2display/etc/confd/templates/default.conf.tmpl b/infrastructure/os2display/etc/confd/templates/default.conf.tmpl index 3dea9060..27f75763 100644 --- a/infrastructure/os2display/etc/confd/templates/default.conf.tmpl +++ b/infrastructure/os2display/etc/confd/templates/default.conf.tmpl @@ -4,14 +4,14 @@ server { root /var/www/html; index index.html index.htm; + add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; + add_header Pragma "no-cache"; + add_header Expires "0"; + # Any route containing a file extension (e.g. /devicesfile.js) location ~* ^{{ getenv "APP_ADMIN_CLIENT_PATH" "" }}/(.+\..+)$ { rewrite ^{{ getenv "APP_ADMIN_CLIENT_PATH" "/" }}(.*) /$1 break; - add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - add_header Pragma "no-cache"; - add_header Expires "0"; - try_files $uri =404; } @@ -19,10 +19,6 @@ server { rewrite ^{{ getenv "APP_ADMIN_CLIENT_PATH" "/" }}(.*) /$1 break; autoindex off; - add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; - add_header Pragma "no-cache"; - add_header Expires "0"; - try_files $uri /index.html; }