From 8875a8f12c0bf99a1ea413763099afab832ed31b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 7 Aug 2025 11:42:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20nginx.common.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/nginx.common.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/nginx.common.conf b/docker/nginx.common.conf index 04b54431..d748907b 100644 --- a/docker/nginx.common.conf +++ b/docker/nginx.common.conf @@ -15,6 +15,13 @@ location ~* \.(png|jpg|jpeg|gif|ico|svg)$ { add_header Cache-Control "public, immutable"; } +# JS和CSS静态资源缓存 +location ~* \.(js|css)$ { + expires 30d; + add_header Cache-Control "public"; + add_header Vary Accept-Encoding; +} + # assets目录 location /assets { expires 1y;