From 3a1a24798646965b498a6b25ea0daec041fb02aa Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 13 Dec 2024 09:54:53 +0000 Subject: [PATCH] improve cache control response headers "Cache-Control: public, no-cache" response header is ambiguous as public means the response can be cached. Change this to just "no-cache" This should not have any effect but it's easier to understand like this --- 88-tar1090.conf | 12 ++++++------ nginx.conf | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/88-tar1090.conf b/88-tar1090.conf index 9fe5580..e09b48f 100644 --- a/88-tar1090.conf +++ b/88-tar1090.conf @@ -17,14 +17,14 @@ alias.url += ( $HTTP["url"] =~ "^/INSTANCE/data/.*\.binCraft$" { compress.filetype = () setenv.add-response-header += ( - "Cache-Control" => "public, no-cache", + "Cache-Control" => "no-cache", "Content-Encoding" => "gzip", ) } $HTTP["url"] =~ "^/INSTANCE/data/.*\.zst$" { compress.filetype = () setenv.add-response-header += ( - "Cache-Control" => "public, no-cache", + "Cache-Control" => "no-cache", ) } $HTTP["url"] =~ "^/INSTANCE/chunks/chunk_.*gz$" { @@ -45,25 +45,25 @@ $HTTP["url"] =~ "^/INSTANCE/chunks/current_.*gz$" { } $HTTP["url"] =~ "^/INSTANCE/chunks/978\.json$" { setenv.add-response-header += ( - "Cache-Control" => "public, no-cache", + "Cache-Control" => "no-cache", ) } $HTTP["url"] =~ "^/INSTANCE/data/aircraft\.json$" { setenv.add-response-header += ( - "Cache-Control" => "public, no-cache", + "Cache-Control" => "no-cache", ) } $HTTP["url"] =~ "^/INSTANCE/data/globe.*json$" { compress.filetype = () setenv.add-response-header += ( - "Cache-Control" => "public, no-cache", + "Cache-Control" => "no-cache", "Content-Encoding" => "gzip", ) } $HTTP["url"] =~ "^/INSTANCE/data/traces/" { compress.filetype = () setenv.add-response-header += ( - "Cache-Control" => "public, no-cache", + "Cache-Control" => "no-cache", "Content-Encoding" => "gzip", ) } diff --git a/nginx.conf b/nginx.conf index c721acc..496181d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,35 +3,35 @@ location /INSTANCE/data/ { alias SOURCE_DIR/; gzip_static off; location ~ aircraft\.json$ { - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; gzip on; gzip_static on; } location /INSTANCE/data/traces/ { location ~ trace_recent { gzip off; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; add_header Content-Encoding "gzip"; } location ~ trace_full { gzip off; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; add_header Content-Encoding "gzip"; } } location ~ globe_.*\.json$ { gzip off; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; add_header Content-Encoding "gzip"; } location ~ .*\.binCraft$ { gzip off; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; add_header Content-Encoding "gzip"; } location ~ .*\.zst$ { gzip off; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; } } @@ -46,7 +46,7 @@ location /INSTANCE/globe_history/ { location ~ /acas/ { default_type text/plain; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; gzip_static on; } @@ -85,7 +85,7 @@ location /INSTANCE/chunks/ { } location ~ .*\.json$ { gzip on; - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; } } @@ -108,12 +108,12 @@ location /INSTANCE { # exact matches location = /INSTANCE/config.js { - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; gzip on; gzip_static on; } location = /INSTANCE/index.html { - add_header Cache-Control "public, no-cache"; + add_header Cache-Control "no-cache"; gzip on; gzip_static on; }