Skip to content

Commit

Permalink
improve cache control response headers
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
wiedehopf committed Dec 13, 2024
1 parent 9043ebe commit 3a1a247
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions 88-tar1090.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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$" {
Expand All @@ -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",
)
}
Expand Down
20 changes: 10 additions & 10 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -85,7 +85,7 @@ location /INSTANCE/chunks/ {
}
location ~ .*\.json$ {
gzip on;
add_header Cache-Control "public, no-cache";
add_header Cache-Control "no-cache";
}
}

Expand All @@ -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;
}
Expand Down

0 comments on commit 3a1a247

Please sign in to comment.