feat(web): enable gzip in the nginx vhost
Some checks failed
deploy / Build api + worker (static musl) (push) Successful in 6m9s
deploy / Build prerendered web (push) Successful in 7m32s
deploy / Deploy moments-api to nikola (push) Successful in 56s
deploy / Deploy web to oolon (push) Successful in 54s
deploy / Deploy moments-worker to frootmig (push) Successful in 57s
refresh / Rebuild prerendered web (push) Successful in 6m59s
refresh / Deploy refreshed web to oolon (push) Has been cancelled
Some checks failed
deploy / Build api + worker (static musl) (push) Successful in 6m9s
deploy / Build prerendered web (push) Successful in 7m32s
deploy / Deploy moments-api to nikola (push) Successful in 56s
deploy / Deploy web to oolon (push) Successful in 54s
deploy / Deploy moments-worker to frootmig (push) Successful in 57s
refresh / Rebuild prerendered web (push) Successful in 6m59s
refresh / Deploy refreshed web to oolon (push) Has been cancelled
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7zF7Kf4JqDwa6M8Qgge9M
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user