Sergey Kandaurov
January 24, 2023 06:18AM
details: https://hg.nginx.org/nginx/rev/c7e103acb409
branches:
changeset: 8120:c7e103acb409
user: Maxim Dounin <mdounin@mdounin.ru>
date: Tue Jan 24 03:01:51 2023 +0300
description:
Gzip static: ranges support (ticket #2349).

In contrast to on-the-fly gzipping with gzip filter, static gzipped
representation as returned by gzip_static is persistent, and therefore
the same binary representation is available for future requests, making
it possible to use range requests.

Further, if a gzipped representation is re-generated with different
compression settings, it is expected to result in different ETag and
different size reported in the Content-Range header, making it possible
to safely use range requests anyway.

As such, ranges are now allowed for files returned by gzip_static.

diffstat:

src/http/modules/ngx_http_gzip_static_module.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r ec26874c3f60 -r c7e103acb409 src/http/modules/ngx_http_gzip_static_module.c
--- a/src/http/modules/ngx_http_gzip_static_module.c Mon Jan 23 05:01:01 2023 +0300
+++ b/src/http/modules/ngx_http_gzip_static_module.c Tue Jan 24 03:01:51 2023 +0300
@@ -247,6 +247,8 @@ ngx_http_gzip_static_handler(ngx_http_re
ngx_str_set(&h->value, "gzip");
r->headers_out.content_encoding = h;

+ r->allow_ranges = 1;
+
/* we need to allocate all before the header would be sent */

b = ngx_calloc_buf(r->pool);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Gzip static: ranges support (ticket #2349).

Sergey Kandaurov 429 January 24, 2023 06:18AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready