Changes between Initial Version and Version 1 of Ticket #2349


Ignore:
Timestamp:
05/09/22 05:14:55 (22 months ago)
Author:
CAFxX@…
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2349 – Description

    initial v1  
    33It is worth noting though that this argument does not apply to responses served by gzip_static, as in this case the content is actually already gzip-encoded, and the length and ETag of the encoded content are known, and therefore satisfying the HTTP semantics of range requests + content-encoding is not difficult.
    44
    5 I would therefore suggest that, for responses that gzip_static can satisfy, the gzip_static module should add `Accept-Ranges: bytes` to the response (in addition to the `Etag`/`Last-Modified`/`Content-Encoding` headers that are already added), and add support for handling the `Range: <ranges>` and `If-Range: <etag>/<lastmod>` request headers in accordance with the HTTP spec (i.e. serve byte ranges interpreted as referring to the gzip-encoded resource; if an If-Range header is present in the request and it matches the current gzip-encoded resource, send 206 and the requested range, otherwise send 200 and the full gzip-encoded resource).
     5I would therefore suggest that, for responses that gzip_static can satisfy, the gzip_static module should add `Accept-Ranges: bytes` to the response (in addition to the `Etag`/`Last-Modified`/`Content-Encoding` headers that are already added), and add support for handling the `Range: <ranges>` and `If-Range: <etag>/<lastmod>` request headers in accordance with the HTTP spec (i.e. serve byte ranges interpreted as referring to the gzip-encoded resource; if an `If-Range` header is present in the request and it matches the current gzip-encoded resource, send 206 and the requested range, otherwise send 200 and the full gzip-encoded resource).
    66
    77If we are worried this may break some non-compliant clients, it may be worthwhile to add an option to enable/disable range requests in gzip_static.