fix nginx cache

This commit is contained in:
jxxghp 2024-05-17 13:58:29 +08:00
parent a50427948a
commit 01a3efd402

View File

@ -34,10 +34,16 @@ http {
try_files $uri $uri/ /index.html;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
# 静态资源
expires 1y;
add_header Cache-Control "public, immutable";
}
location /assets {
# 静态资源
expires 7d;
add_header Cache-Control "public";
expires 1y;
add_header Cache-Control "public, immutable";
root /public;
}