diff --git a/docker/nocobase/nocobase.conf b/docker/nocobase/nocobase.conf index 0279113cfc..f1faae0b60 100644 --- a/docker/nocobase/nocobase.conf +++ b/docker/nocobase/nocobase.conf @@ -6,10 +6,18 @@ server { client_max_body_size 20M; gzip on; - gzip_vary on; - gzip_min_length 1024; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/javascript application/xml; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + # 不缓存 HTML 文件 + location ~ \.html$ { + expires -1; + } + + # 缓存 JavaScript 和 CSS 文件 + location ~* \.(js|css)$ { + expires 1d; + add_header Cache-Control "public"; + } location /storage/uploads/ { alias /app/nocobase/storage/uploads/;