O'Reilly logo

NGINX High Performance by Rahul Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compression

Compression can improve website speed by reducing the amount of data transferred over the network. NGINX offers a couple of alternatives to use for serving compressed content.

ngx_http_gzip_module

This module enables gzip compression in NGINX. The server compresses the data and then sends it over wire. Compression is mostly helpful in serving textual content. It does not help in serving noncompressible content, such as JPEG, GIF, MP3, and so on. Also, if the compression level is high, there is not much gain in terms of the compressed data size, and the server mostly ends up wasting CPU cycles.

The module offers the following directives to configure the gzip compression.

gzip

This directive enables gzip compression in NGINX. By default, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required