From b56d073e2f451b58e04131df9faa13e320a7bb2d Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Mon, 13 Feb 2023 22:01:44 +0000 Subject: [PATCH] Update caching --- conf/nginx.conf | 8 +++++++- index.html | 2 +- sw.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index cca8691..9e2dcf1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -39,7 +39,7 @@ http { gzip_static on; brotli_static on; error_page 404 /404.html; - expires 3600; + expires 3d; add_header Cache-Control "public, no-transform"; } @@ -52,6 +52,12 @@ http { add_header Cache-Control "private, no-transform"; } + location /api/stats/ { + proxy_pass http://backend; + expires 20; + add_header Cache-Control "public, no-transform"; + } + location /api/v1/list/ { proxy_pass http://backend; proxy_cache_key $scheme://$host$uri$is_args$query_string; diff --git a/index.html b/index.html index 8e1316f..90b4401 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@ diff --git a/sw.js b/sw.js index 1774d8e..decf064 100644 --- a/sw.js +++ b/sw.js @@ -1,6 +1,6 @@ /* Service Worker */ -const appVersion = "0.1.3-test" +const appVersion = "0.1.4-test" const cacheName = `owlboard-${appVersion}` const cacheIDs = [cacheName] const cacheFiles = [