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
This commit is contained in:
Matthias Wirth
2024-12-13 09:54:53 +00:00
parent 9043ebe7bb
commit 3a1a247986
2 changed files with 16 additions and 16 deletions

View File

@@ -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",
)
}

View File

@@ -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;
}