perf(web): 优化静态资源缓存与代码分割

This commit is contained in:
ddCat
2026-09-14 20:32:17 +08:00
parent e368530fa0
commit 61b1c8ca2d
2 changed files with 13 additions and 10 deletions

View File

@@ -23,6 +23,15 @@ server {
gzip_vary on;
gzip_types application/json application/javascript text/css text/plain image/svg+xml;
# Vite assets use content hashes, so they are safe to cache across deployments.
# Keep index.html uncached below so it always points to the current asset manifest.
location ^~ /assets/ {
access_log off;
try_files $uri =404;
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable" always;
}
location ^~ /api/public/canvas-shares/ {
access_log off;
proxy_pass http://backend:8080;