From ca7e679ebba5d2cedb22b9c2fcafd6b37da4595e Mon Sep 17 00:00:00 2001 From: Max Schmidt Date: Tue, 24 Oct 2023 10:05:51 +0200 Subject: [PATCH] Optimize caching for static files --- astro/nginx.conf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/astro/nginx.conf b/astro/nginx.conf index 2722f3c..c7597ef 100644 --- a/astro/nginx.conf +++ b/astro/nginx.conf @@ -23,20 +23,18 @@ http { location /error_page.html { internal; } - - location ~* \.(jpg|jpeg|png|gif|ico|css|html)$ { + + location ~* \.(jpg|jpeg|png|gif|ico|css|html)$ { expires 30d; add_header Pragma public; add_header Cache-Control "public"; } - location ~* \.js$ { expires 30d; add_header Pragma public; add_header Cache-Control "public"; add_header Content-Type application/javascript; } - error_page 404 /404.html; } } \ No newline at end of file