diff options
| author | Christian Cleberg <[email protected]> | 2025-11-11 22:49:13 -0600 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2025-11-11 22:49:13 -0600 |
| commit | 51a7a02f0c96d49b68fbcc155414c218207fa270 (patch) | |
| tree | 845af8aad0e8769352efc02fcd1044eed9cc1ec1 /content/blog/2022-12-01-nginx-compression.org | |
| parent | 7d3e80ebf1dc770eac0e21890b74f18ba2d15a6b (diff) | |
| download | cleberg.net-51a7a02f0c96d49b68fbcc155414c218207fa270.tar.gz cleberg.net-51a7a02f0c96d49b68fbcc155414c218207fa270.tar.bz2 cleberg.net-51a7a02f0c96d49b68fbcc155414c218207fa270.zip | |
fix grammar in 2022 posts
Diffstat (limited to 'content/blog/2022-12-01-nginx-compression.org')
| -rw-r--r-- | content/blog/2022-12-01-nginx-compression.org | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/content/blog/2022-12-01-nginx-compression.org b/content/blog/2022-12-01-nginx-compression.org index 09b555b..c85c49b 100644 --- a/content/blog/2022-12-01-nginx-compression.org +++ b/content/blog/2022-12-01-nginx-compression.org @@ -5,24 +5,23 @@ * Text Compression -Text compression allows a web server to serve text-based resources -faster than uncompressed data. This can speed up things like First -Contentful Paint, Tie to Interactive, and Speed Index. +Text compression allows a web server to serve text-based resources faster than +uncompressed data. This can speed up things like First Contentful Paint, Tie to +Interactive, and Speed Index. * Enable Nginx Compression with gzip -In order to enable text compression on Nginx, we need to enable it -within the configuration file: +In order to enable text compression on Nginx, we need to enable it within the +configuration file: #+begin_src sh nano /etc/nginx/nginx.conf #+end_src -Within the =http= block, find the section that shows something like the -block below. This is the default gzip configuration I found in my -=nginx.conf= file on Alpine Linux 3.17. Yours may look slightly -different, just make sure that you're not creating any duplicate gzip -options. +Within the =http= block, find the section that shows something like the block +below. This is the default gzip configuration I found in my =nginx.conf= file on +Alpine Linux 3.17. Yours may look slightly different, just make sure that you're +not creating any duplicate gzip options. #+begin_src conf # Enable gzipping of responses. @@ -46,31 +45,27 @@ gzip_disable "MSIE [1-6]"; * Explanations of ngx_{httpgzipmodule} Options -Each of the lines above enables a different aspect of the gzip response -for Nginx. Here are the full explanations: +Each of the lines above enables a different aspect of the gzip response for +Nginx. Here are the full explanations: -- =gzip= -- Enables or disables gzipping of responses. -- =gzip_vary= -- Enables or disables inserting the "Vary: - Accept-Encoding" response header field if the directives gzip, - gzip_{static}, or gunzip are active. -- =gzip_min_length= -- Sets the minimum length of a response that will - be gzipped. The length is determined only from the "Content-Length" - response header field. -- =gzip_proxied= -- Enables or disables gzipping of responses for - proxied requests depending on the request and response. The fact that - the request is proxied is determined by the presence of the "Via" - request header field. -- =gzip_types= -- Enables gzipping of responses for the specified MIME - types in addition to "text/html". The special value "*" matches any - MIME type (0.8.29). Responses with the "text/html" type are always - compressed. -- =gzip_disable= -- Disables gzipping of responses for requests with - "User-Agent" header fields matching any of the specified regular - expressions. - - The special mask "msie6" (0.7.12) corresponds to the regular - expression "MSIE [4-6].", but works faster. Starting from version - 0.8.11, "MSIE 6.0; ... SV1" is excluded from this mask. +- =gzip=: Enables or disables gzipping of responses. +- =gzip_vary=: Enables or disables inserting the "Vary: Accept-Encoding" + response header field if the directives gzip, gzip_{static}, or gunzip are + active. +- =gzip_min_length=: Sets the minimum length of a response that will be + gzipped. The length is determined only from the "Content-Length" response + header field. +- =gzip_proxied=: Enables or disables gzipping of responses for proxied + requests depending on the request and response. The fact that the request is + proxied is determined by the presence of the "Via" request header field. +- =gzip_types=: Enables gzipping of responses for the specified MIME types in + addition to "text/html". The special value "*" matches any MIME type (0.8.29). + Responses with the "text/html" type are always compressed. +- =gzip_disable=: Disables gzipping of responses for requests with + "User-Agent" header fields matching any of the specified regular expressions. + - The special mask "msie6" (0.7.12) corresponds to the regular expression + "MSIE [4-6].", but works faster. Starting from version 0.8.11, "MSIE 6.0; + ... SV1" is excluded from this mask. -More information on these directives and their options can be found on -the [[https://nginx.org/en/docs/http/ngx_http_gzip_module.html][Module -ngx_{httpgzipmodule}]] page in Nginx's documentation. +More information on these directives and their options can be found on the +[[https://nginx.org/en/docs/http/ngx_http_gzip_module.html][Module ngx_{httpgzipmodule}]] page in Nginx's documentation. |
