perf: 优化管理端生产加载体验

- 图标与重型组件按需加载,优化菜单预取和页面请求链路

- 开启 gzip 与静态缓存并修复子路由 KeepAlive 冲突
This commit is contained in:
2026-07-22 20:35:55 +08:00
parent 9f06c238d3
commit 19059fde96
27 changed files with 750 additions and 233 deletions

View File

@@ -22,7 +22,7 @@ RUN rm -f /etc/nginx/conf.d/default.conf
COPY --from=builder /app/app/dist/ /usr/share/nginx/html/flow/
COPY scripts/deploy/nginx.conf /etc/nginx/nginx.conf
RUN chown -R nginx:nginx /usr/share/nginx/html
RUN nginx -t && chown -R nginx:nginx /usr/share/nginx/html
EXPOSE 80

View File

@@ -12,6 +12,22 @@ http {
keepalive_timeout 65;
client_max_body_size 500m;
gzip on;
gzip_static on;
gzip_vary on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_proxied any;
gzip_types
application/javascript
application/json
application/xml
application/wasm
image/svg+xml
text/css
text/plain
text/xml;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
@@ -90,9 +106,26 @@ http {
proxy_redirect off;
}
location ^~ /flow/ {
location = /flow/index.html {
root /usr/share/nginx/html;
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
}
location = /flow/_app.config.js {
root /usr/share/nginx/html;
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
}
location ~* ^/flow/(?:avif|css|eot|gif|ico|jpeg|jpg|js|jse|png|svg|ttf|wasm|webp|woff|woff2)/ {
root /usr/share/nginx/html;
try_files $uri =404;
add_header Cache-Control "public, max-age=31536000, immutable" always;
}
location /flow/ {
root /usr/share/nginx/html;
try_files $uri $uri/ /flow/index.html;
add_header Cache-Control "no-cache" always;
}
}
}