From 92da3988da3f743acf5455bb1b0b02f26f8d632a Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 18 Jul 2022 17:47:33 -0500 Subject: [PATCH] Reduce nginx cache time for production homepage --- production/nginx/server-common.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/production/nginx/server-common.conf b/production/nginx/server-common.conf index 901a490cb..f1b21c1e0 100644 --- a/production/nginx/server-common.conf +++ b/production/nginx/server-common.conf @@ -46,13 +46,13 @@ add_header Vary Cookie; # https://stackoverflow.com/questions/5238377/nginx-location-priority # for exact / requests, redirect based on $lang -# cache redirect for 10 minutes +# cache redirect for 5 minutes location = / { if ($lang != '') { return 302 $scheme://$host/$lang/; } try_files /en-US/index.html =404; - expires 10m; + expires 5m; } # used to rewrite resources from // to /en-US/ @@ -66,14 +66,14 @@ location ~ ^/([a-z][a-z])/(.+\..+\.(js|css)) { try_files $uri =404; expires 1y; } -# cache everything else for 10 minutes +# cache everything else for 5 minutes location ~ ^/([a-z][a-z])$ { try_files $uri /$1/index.html /en-US/index.html =404; - expires 10m; + expires 5m; } location ~ ^/([a-z][a-z])/ { try_files $uri /$1/index.html /en-US/index.html =404; - expires 10m; + expires 5m; } # cache /resources/** for 1 week since they don't change often @@ -87,8 +87,8 @@ location ~* ^/.+\..+\.(js|css) { expires 1y; } # catch-all for all URLs i.e. /address/foo /tx/foo /block/000 -# cache 10 minutes since they change frequently +# cache 5 minutes since they change frequently location / { try_files /$lang/$uri $uri /en-US/$uri /en-US/index.html =404; - expires 10m; + expires 5m; }