Blog · WebJi® India

Enable GZIP Compression on Nginx and Apache (Plus

Quick answer: Enable GZIP Compression on Nginx and Apache (Plus from WebJi®, billed in INR with 18% GST on the invoice. Email support@webji.services is 24/7 in Hindi and English (average first reply under 60 minutes). Phone +91 141 4941811 is business hours only. The company has been in this business since 2005.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Warm modern Jaipur office interior with jaali lattice screens and an Indian team at work — enable gzip compression nginx

What Gzip Compression Does

The complete block, ready to paste:

  1. gzip on;
  2. gzip_vary on;
  3. gzip_proxied any;
  4. gzip_comp_level 5;
  5. gzip_min_length 256;
  6. gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss image/svg+xml text/javascript application/ld+json;

Line by line: gzip_vary adds Vary: Accept-Encoding — required correctness for caches and CDNs. ._proxied any compresses responses to proxies (fronted-by-CDN setups); without it, proxied requests skip compression. Level 5 is the sweet spot; min_length 256 skips tiny responses where overhead beats savings. The types list covers everything textual; WOFF2 and images are deliberately absent — they are already compressed. Note: most distributions ship gzip on with only text/html in gzip_types — the reason your HTML may compress while CSS does not; extend the list.

Required Nginx Directives (Complete Block)

Two practical notes on ngx_http_gzip_module: it interacts directly with caching and database response, and misconfiguration is the most common cause of 'hosting is slow' tickets. WebJi® support checks it as part of standard migrations.

Warm modern Jaipur office interior with jaali lattice screens and an Indian team at work — enable gzip compression nginx

Where to Place the Config (http vs server)

Two practical notes on gzip on directive: it interacts directly with caching and database response, and misconfiguration is the most common cause of 'hosting is slow' tickets. WebJi® support checks it as part of standard migrations.

Testing With curl and Online Checkers

On gzip_types and gzip_comp_level, the honest summary is that defaults matter more than brand names — a well-set budget plan outranks a mis-tuned premium one. WebJi® documents its defaults openly and adjusts them per ticket when workloads need it.

Tuning: Levels, min_length, proxied assets

Two practical notes on gzip_min_length: it interacts directly with caching and database response, and misconfiguration is the most common cause of 'hosting is slow' tickets. WebJi® support checks it as part of standard migrations.

Gzip vs Brotli: Which to Use

Gzip: universal — every browser since 1999 and every proxy, CDN and device understands it; zero compatibility risk; the sensible default everywhere. Brotli: Google's newer format — 15–25% smaller than gzip on text at comparable CPU, supported by all modern browsers over HTTPS. But not built into stock Nginx — it needs the ngx_brotli module, after which brotli on and brotli_types mirror the gzip config.

The pattern that wins: enable both — Nginx negotiates via Accept-Encoding, so modern browsers get Brotli and everything else gets gzip — with static pre-compressed .br files for the high-traffic set. Pragmatic hierarchy: properly configured gzip captures ~90% of the win in ten minutes; Brotli is the addition for teams with build pipelines chasing the last percentages. On managed hosting (WebJi®'s LiteSpeed stacks), compression is handled server-side — verify with curl and move on.

Reloading Nginx and Common Mistakes

Reloading Nginx and Common Mistakes. Do the change this heading names on one site first, then check it in a private browser window or in the mail client, depending on the topic. Change one setting at a time, and undo it if the result is wrong before you try the next. If you want the Jaipur desk to look with you, email support@webji.services — that mailbox is staffed 24/7 in Hindi and English. Phone +91 141 4941811 is business hours only.

Frequently Asked Questions

How do I enable gzip compression in Nginx?

The pattern that wins: enable both — Nginx negotiates via Accept-Encoding, so modern browsers get Brotli and everything else gets gzip — with static pre-compressed .br files for the high-traffic set. Pragmatic hierarchy: properly configured gzip captures ~90% of the win in ten minutes; Brotli is the addition for teams with build pipelines chasing the last percentages.

How do I test whether gzip is working?

Enable GZIP Compression on Nginx and Apache (Plus. Email support@webji.services is 24/7 in Hindi and English, average first reply under 60 minutes. Phone +91 141 4941811 is business hours. If the question is about your own account, open a ticket at https://billing.webji.in/submitticket.php?step=2&deptid=10.

Which gzip settings give the best speed?

For Enable GZIP Compression on Nginx and Apache (Plus, judge a provider on three things: where the server sits for your visitors, whether the bill is INR with GST, and whether a person reads email at night. WebJi® has done this since 2005, serves 12,000+ clients online across India and overseas, and publishes a 99.9% uptime target. Ask for an INR quote if this page has no plan table. Email is support@webji.services, 24/7, Hindi and English.

Which file types should be gzipped?

Enable GZIP Compression on Nginx and Apache (Plus. Email support@webji.services is 24/7 in Hindi and English, average first reply under 60 minutes. Phone +91 141 4941811 is business hours. If the question is about your own account, open a ticket at https://billing.webji.in/submitticket.php?step=2&deptid=10. The question here is: Which file types should be gzipped.

What is the difference between gzip and Brotli?

Gzip: universal — every browser since 1999 and every proxy, CDN and device understands it; zero compatibility risk; the sensible default everywhere. Brotli: Google's newer format — 15–25% smaller than gzip on text at comparable CPU, supported by all modern browsers over HTTPS. But not built into stock Nginx — it needs the ngx_brotli module, after which brotli on and brotli_types mirror the gzip config.

Why is Nginx not compressing my CSS and JS?

Line by line: gzip_vary adds Vary: Accept-Encoding — required correctness for caches and CDNs. ._proxied any compresses responses to proxies (fronted-by-CDN setups); without it, proxied requests skip compression. Level 5 is the sweet spot; min_length 256 skips tiny responses where overhead beats savings. The types list covers everything textual; WOFF2 and images are deliberately absent — they are already compressed.

Is WebJi® an Indian company?

Yes. WebJi® is headquartered in Jaipur, Rajasthan and has operated since 2005. Billing, support and governance all run from India.

Do you provide GST invoices?

Every purchase and renewal gets a GST invoice with our GSTIN, and hosting prices are quoted exclusive of 18% GST. Claim input credit as applicable.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →