From 29b163acdaf9272fad5028df7d7ee522ab08ee70 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 2 Feb 2023 21:00:24 +0000 Subject: [PATCH] Frontend: Add Cache-Control Headers Signed-off-by: Fred Boniface --- static/conf/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/conf/nginx.conf b/static/conf/nginx.conf index 07bea91..2589b38 100644 --- a/static/conf/nginx.conf +++ b/static/conf/nginx.conf @@ -33,6 +33,8 @@ http { gzip_static on; brotli_static on; error_page 404 /404.html; + expires 7d; + add_header Cache-Control "public, no-transform" } location /api/ { @@ -42,6 +44,8 @@ http { proxy_cache_valid 200 2m; # Evaluate whether 2m or 1m is more appropriate gzip on; brotli on; + expires 2m; + add_header Cache-Control "private, no-transform" } location /api/v1/list/ { @@ -49,6 +53,8 @@ http { proxy_cache_key $scheme://$host$uri$is_args$query_string; proxy_ignore_headers Cache-Control; proxy_cache_valid 200 10080m; + expires 10080m; + add_header Cache-Control "public, no-transform" } } }