From b7b0b0dad4d2072f0c1d68bba37463a2e4d1e064 Mon Sep 17 00:00:00 2001 From: Corry Haines Date: Tue, 27 Dec 2022 10:25:18 -0800 Subject: [PATCH] Add cache-control header for static assets (#281) --- docker/nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/nginx.conf b/docker/nginx.conf index f5076cb..d4c95e8 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -38,6 +38,9 @@ http { # Serves static files from the collected dir location /static/ { + # Files in static have cache-busting hashes in the name, thus can be cached forever + add_header Cache-Control "public, max-age=604800, immutable"; + alias /takahe/static-collected/; try_files $uri /static//static-real$uri; }