Press your own CSS with real gzip and weigh its bytes: how small does it get, and what about a photo pressed again, a body pressed twice, a halte with no…
Compression cuts the text bytes crossing the wire, so pages arrive sooner. But a photo pressed again grows, a body pressed twice reads as garbage, a halte with no Vary hands a gzip copy to a client that did not ask, and DevTools shows two numbers that are often swapped: bytes on the wire and bytes unpacked.
Content-Encoding belongs to the contents; Transfer-Encoding to one connection
gzip_types in nginx: HTML, CSS, JS, JSON, SVG).Vary: Accept-Encoding Without it, a cache (a CDN, a proxy) takes one URL for one reply and hands a gzip copy to a client that cannot unpack it. Write Vary: Accept-Encoding on every reply whose form depends on Accept-Encoding.transferred and resource in DevTools Transferred is the bytes on the wire (pressed, plus headers); resource is the size once unpacked, what your code reads. For download speed read transferred; for memory and parsing read resource.Content-Encoding, then the server in front gzips again: only one label is written, the browser unpacks one layer, and your code gets gzip bytes. One press, one label: write Content-Encoding or let only the server press.Vary on for Bagas’s curl The halte keeps its copies apart by Accept-Encoding.