RangeリクエストがクライアントのAccept-Encodingを尊重するように
原題: Range requests respect client Accept-Encoding
changelog / Other / Cache / 2026/11/24 09:00 JST
CloudflareがRangeリクエストとコンテンツエンコーディングの扱いをRFC 9110に沿って見直した。gzipやBrotliで圧縮されたキャッシュ済みファイルのバイト範囲は、展開後ではなく圧縮後のバイト数で数えるのが正しい動作で、クライアントがそのエンコーディングをAccept-Encodingで明示していない場合はRangeを無視してファイル全体を200 OKで返すようになった。zstdやdeflateで圧縮されたファイルは常に全体を返す。従来はエンコーディングに対応していないクライアントにContent-Rangeと食い違う206応答を返す恐れがあった。キャッシュ対象外のHTTPS GETでは、Cloudflare既定のAccept-Encodingではなくクライアント自身のヘッダーをオリジンへ転送するようになった。動画のシークや大容量ファイルの再開ダウンロードなど、Rangeを使う配信の挙動がより予測しやすくなる。
出典サイトで原文を開く → 出典サイトの説明: Uncached HTTPS GET range requests now forward the client
Cloudflare updated how range requests handle content encoding for both cached files and uncached GET requests over HTTPS. Cached encoded files A 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 If 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
出典: 公式ページ