ENF News Bot
Automated News Bot
- Joined
- Apr 15, 2022
- Messages
- 4,544
Cloudflare updated how range requests handle content encoding for both cached files and uncached
A byte range of a cached file encoded with gzip or Brotli (
Previously, a client that did not accept the encoding could receive a
If caching is bypassed or the request is not eligible for caching, Cloudflare forwards the client's
If a client sends no
Range requests that Cloudflare serves from cache, or fetches with Origin Range Requests, still send Cloudflare's own
For more information, refer to Range request behavior.
Continue reading...
GET requests over HTTPS.Cached encoded files
https://developers.cloudflare.com/changelog/rss/#cached-encoded-filesA byte range of a cached file encoded with gzip or Brotli (
br) counts bytes of the encoded file, not of the decompressed content (RFC 9110, section 14.1.2 ↗︎). Cloudflare now serves that range only if the client's Accept-Encoding header explicitly lists the encoding without q=0 (and over HTTPS for Brotli). Otherwise, Cloudflare ignores Range (RFC 9110, section 14.2 ↗︎) and sends the complete file as 200 OK using normal content negotiation. Cloudflare always sends the complete 200 OK file for a cached file encoded with Zstandard (zstd) or deflate.Previously, a client that did not accept the encoding could receive a
206 Partial Content response whose bytes did not match its Content-Range header.Uncached range requests
https://developers.cloudflare.com/changelog/rss/#uncached-range-requestsIf caching is bypassed or the request is not eligible for caching, Cloudflare forwards the client's
Range header to your origin. For GET requests over HTTPS, Cloudflare now also forwards the client's own Accept-Encoding header instead of Cloudflare's default gzip, br header. Previously, Cloudflare passed your origin's byte-range 206 Partial Content response to the client without decoding it, so a client could receive a range in an encoding it did not accept.If a client sends no
Accept-Encoding header (on Orange-to-Orange requests), or sends only stripped dictionary encodings (dcb or dcz), your origin can receive an empty Accept-Encoding header. Under RFC 9110, section 12.5.3 ↗︎, an empty Accept-Encoding header means the client accepts no encoding, so your origin should answer it with an unencoded response rather than 406 Not Acceptable.Range requests that Cloudflare serves from cache, or fetches with Origin Range Requests, still send Cloudflare's own
Accept-Encoding header to your origin.For more information, refer to Range request behavior.
Continue reading...