From fd33acd33a4ddd4ba72128d3e13bad1c6934000d Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Thu, 25 Jun 2026 15:52:43 +0300 Subject: [PATCH] feat(web): enable gzip in the nginx vhost The prerendered pages are large (the dashboard bakes the full all-time activity dataset, ~900 KB), so compress text responses on the wire. text/html is always compressed when gzip is on; the listed gzip_types also cover the JS bundle, CSS, SVG icons, and (via gzip_proxied any) the JSON from the /api/ upstream. The home page drops to ~90 KB on the wire. woff2 is pre-compressed and intentionally omitted. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01X7zF7Kf4JqDwa6M8Qgge9M --- asset/nginx/site.conf.tmpl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/asset/nginx/site.conf.tmpl b/asset/nginx/site.conf.tmpl index 24e59ad..cceb223 100644 --- a/asset/nginx/site.conf.tmpl +++ b/asset/nginx/site.conf.tmpl @@ -15,6 +15,29 @@ server { root {{DOCROOT}}; index index.html; + # Compress text responses on the wire. text/html is always compressed when + # gzip is on (nginx won't let it be listed in gzip_types); the prerendered + # pages are large — the dashboard bakes the full all-time activity dataset — + # so the HTML alone drops from ~900 KB to ~90 KB. gzip_proxied any also + # compresses the JSON from the /api/ upstream. woff2 is already compressed, + # so it's intentionally not listed. + gzip on; + gzip_vary on; + gzip_comp_level 6; + gzip_min_length 1024; + gzip_proxied any; + gzip_types + text/css + text/javascript + text/plain + text/xml + application/javascript + application/json + application/manifest+json + application/xml + image/svg+xml + font/ttf; + location / { try_files $uri $uri/ /index.html; add_header Cache-Control "no-cache" always;