From 5316b87aca17bd1713fe059438b8dcaf171cc3b9 Mon Sep 17 00:00:00 2001 From: Steven Kearnes Date: Tue, 6 Oct 2026 19:36:05 -0400 Subject: [PATCH] Compress the SPA's bundles and the API's JSON in nginx nginx.conf turned gzip on but set no gzip_types, so nginx compressed only text/html: the 929 KB JS bundle, the CSS, and every JSON API response went out uncompressed. It now compresses text, CSS, JavaScript, JSON, XML, SVG, and WebAssembly over 1 KB, including proxied responses, at level 6, with Vary: Accept-Encoding. Co-Authored-By: Claude Opus 5.5 --- ord_interface/nginx.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ord_interface/nginx.conf b/ord_interface/nginx.conf index b6c03ff..53eab72 100644 --- a/ord_interface/nginx.conf +++ b/ord_interface/nginx.conf @@ -14,8 +14,17 @@ http { access_log /dev/stdout; error_log /var/log/nginx.log; + # Compress the SPA's bundles and the API's JSON. Without gzip_types nginx compresses + # only text/html, and the load balancer in front passes responses through as they + # are. Level 6 is where the ratio on JSON levels off; higher levels run far slower + # for little more. gzip on; gzip_disable "msie6"; + gzip_comp_level 6; + gzip_min_length 1024; + gzip_proxied any; + gzip_vary on; + gzip_types text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml application/wasm; # Cache policy keyed on the (possibly rewritten) request path: content-hashed # Vite assets are immutable, the SPA entry point must always be revalidated,