शब्दकोश · परफ़ॉर्मेंस

Gzip Compression

Gzip is a widely supported compression format that web servers use to shrink text responses such as HTML, CSS and JavaScript before sending them.

अपडेट: अक्टूबर 6, 2026

Gzip is a lossless compression format based on the DEFLATE algorithm. A web server applies it to text responses on the fly, and the browser decompresses them, so fewer bytes cross the network.

Why it matters

Text compresses well. HTML, CSS, JavaScript, JSON and SVG commonly shrink by 60 to 80 percent, which cuts transfer time and bandwidth cost, especially on slow mobile links. Virtually every browser and client supports it, so it is the safe baseline when Brotli is not available.

Negotiation is automatic. The browser sends Accept-Encoding: gzip, br, and the server replies with Content-Encoding: gzip if it compressed the body.

Example

GET /app.js HTTP/1.1
Accept-Encoding: gzip, deflate, br

HTTP/1.1 200 OK
Content-Type: application/javascript
Content-Encoding: gzip
Vary: Accept-Encoding

In nginx, gzip on; plus gzip_types text/css application/javascript application/json; enables it for those types.

Common mistakes

  • Compressing images, video or zip files. JPEG, PNG, WebP and MP4 are already compressed, so gzip adds CPU cost for little or no gain.
  • Forgetting the Vary: Accept-Encoding header, which can make caches serve compressed data to clients that cannot read it.
  • Setting level 9 for on-the-fly compression; mid levels are usually the better trade-off.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.