freecoding.school100% FREE · NO SIGNUP
Gateway RidgeISSUE #11 of 35

compression · gzip · brotli · zstd

Gateway GusVSTimeout Titan
Gateway Gus saysCompression (gzip, brotli, zstd) shrinks responses on the wire for faster transfers.

Text payloads (JSON, HTML) compress dramatically. The client advertises Accept-Encoding: gzip, br; the server compresses and sets Content-Encoding. Brotli (br) beats gzip on ratio for text; zstd is the newer fast option. Compression is near-free latency savings — enable it for text responses (skip already-compressed binaries like images).

Power-ups you unlock

Timeout Titan attacks — common mistakes

Boss battleName which responses benefit from compression and which don’t.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>Accept-Encoding: br, gzip
→ Content-Encoding: br   (JSON shrinks ~80%)
images/video: already compressed → skip</pre></body></html>
▶ Open the interactive comic issue
‹ Content Negotiation · Accept · VaryHttps · Why Tls Is Non-Negotiable ›