From d44d3fae3e5c596a61fbe13e34a8a5e4494ff202 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Tue, 29 Oct 2019 22:00:29 +0100 Subject: [PATCH] improve caching --- 88-tar1090.conf | 25 ++++++ html/index.html | 48 +++++------ ...erswitcher.css => ol-layerswitcher340.css} | 0 ...ayerswitcher.js => ol-layerswitcher340.js} | 0 html/ol/{ol.css => ol533.css} | 0 html/ol/{ol.css.map => ol533.css.map} | 0 html/ol/{ol.js => ol533.js} | 0 html/ol/{ol.js.map => ol533.js.map} | 0 html/script.js | 4 +- html/style.css | 2 + html/test/markers_test.html | 18 ----- html/test/markers_test.js | 79 ------------------- install.sh | 29 ++++++- nginx.conf | 15 ++++ nginx_webroot.conf | 37 +++++++++ 15 files changed, 131 insertions(+), 126 deletions(-) rename html/ol/{ol-layerswitcher.css => ol-layerswitcher340.css} (100%) rename html/ol/{ol-layerswitcher.js => ol-layerswitcher340.js} (100%) rename html/ol/{ol.css => ol533.css} (100%) rename html/ol/{ol.css.map => ol533.css.map} (100%) rename html/ol/{ol.js => ol533.js} (100%) rename html/ol/{ol.js.map => ol533.js.map} (100%) delete mode 100644 html/test/markers_test.html delete mode 100644 html/test/markers_test.js create mode 100644 nginx_webroot.conf diff --git a/88-tar1090.conf b/88-tar1090.conf index bcf30f7..c3b54f5 100644 --- a/88-tar1090.conf +++ b/88-tar1090.conf @@ -27,6 +27,31 @@ $HTTP["url"] =~ "^/INSTANCE/chunks/current_.*gz$" { "Content-Type" => "application/json", ) } +$HTTP["url"] =~ "^/INSTANCE/db/.*\.json$" { + setenv.add-response-header += ( + "Cache-Control" => "public, max-age=86400", + ) +} +$HTTP["url"] =~ "^/INSTANCE/.*\.png$" { + setenv.add-response-header += ( + "Cache-Control" => "public, max-age=31536000", + ) +} +$HTTP["url"] =~ "^/INSTANCE/spinny.gif$" { + setenv.add-response-header += ( + "Cache-Control" => "public, max-age=31536000", + ) +} +$HTTP["url"] =~ "^/INSTANCE/.*\.js$" { + setenv.add-response-header += ( + "Cache-Control" => "public, max-age=31536000", + ) +} +$HTTP["url"] =~ "^/INSTANCE/.*\.css$" { + setenv.add-response-header += ( + "Cache-Control" => "public, max-age=31536000", + ) +} # Add CORS header $HTTP["url"] =~ "^/INSTANCE/data/.*\.json$" { diff --git a/html/index.html b/html/index.html index 4dd3ec5..fd9c8a1 100644 --- a/html/index.html +++ b/html/index.html @@ -5,29 +5,29 @@ - - - - - - - - + + + + + + + + - - + + - - + + - - - - - - - - + + + + + + + + dump1090-fa @@ -531,10 +531,10 @@
Aircraft Positions
-
+
Debug tracks
@@ -576,9 +576,9 @@
-
+
H