Nginx (Seven) gzip compression function

Source: Internet
Author: User

**ngx_http_gzip_module Module Configuration * *

    • gzip on|off; Enable or disable gzip compression response messages;

    • Gzip_comp_level level; Compression ratio, 1-9, default is 1;

    • Gzip_disable regex ...; The regex is a regular expression that matches the type of the client responder, and which browser is prohibited from using the compression function;

    • Gzip_min_length length; the minimum size of the response message that triggers the compression function;

    • Gzip_http_version 1.0/1.1; Sets the minimum version of the Protocol when the compression function is enabled;

    • Gzip_proxied off|expired|no-cache|no-store|private|no_last_modified|no_etag|auth|any.;

Defines the ability to enable compression for a resource with the requested property of a client request, such as expired to enable compression for objects that cannot be cached due to the use of the expire header;

    • Gzip_types mime-type.; Specify the type of resources against which the compression manipulation is performed;

gzip on;    Gzip_http_version 1.0;    Gzip_comp_level 6;    Gzip_disable msie6;    Gzip_min_length 2; Gzip_types text/plain text/css text/xml application/x-javascript application/xml Application/json application/ Java-script;


Note: Enabling compression consumes the CPU but can save bandwidth.

Nginx (Seven) gzip compression function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.