Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Range + If-Range support, end-to-end

オープン
#332 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go

調査の方向性

internal/strategy/apiv1.go と internal/cache/api.go から始め、次に s3_parallel_get.go と disk、memory、tiered、remote バックエンドを調べて、既存の読み取りパスを理解します。Range と If-Range の処理について、client/ と remote の連携を追跡します。各バックエンドが 206 と Content-Range を付けて正しい範囲のバイトを返し、古い If-Range には 200 を返し、満たせない範囲には 416 を返せば完了です。

索引モデルが issue の本文から書いたものです。

説明

etag-range-followup

Follow-up from the ETag support assessment (label: etag-range-followup).

The strong content-hash ETag is already a suitable, tier-stable If-Range validator (a range continuation served from a different tier/pod validates correctly; a changed object correctly forces a full 200). The validator value is fine; the surrounding machinery is entirely missing.

Current gaps
  • apiv1.getObject (internal/strategy/apiv1.go) does io.Copy(w, cr) — always 200, never honours Range, never sets Accept-Ranges, never returns 206/Content-Range/416.
  • The cache.Cache interface (internal/cache/api.go) only exposes a whole-object Open returning an io.ReadCloser; there is no partial-read / seek capability. Only the disk backend reader happens to be seekable.
  • checkConditionals does not evaluate If-Range.
Work
  • Add a partial-read capability to the cache interface — either a range-aware open (offset + length) or a documented seekable-reader contract — and implement it for disk, memory, s3 (S3 already does parallel range GETs internally, see s3_parallel_get.go), tiered, and remote.
  • Implement server-side range handling in apiv1.getObject: parse Range, emit Accept-Ranges: bytes, return 206 with Content-Range for satisfiable ranges and 416 for unsatisfiable ones.
  • Evaluate If-Range (against the strong ETag; fall back to full 200 when the validator does not match) before serving a partial response.
  • Plumb Range/If-Range through the client (client/) and remote backend as needed so a tiered remote tier can serve ranges.
Acceptance

Ranged GET against each backend returns the correct bytes with 206/Content-Range; If-Range with a stale ETag returns the full object with 200; unsatisfiable ranges return 416.

主要言語
Go
スター
41
フォーク
14
平均マージ
19時間 28分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

block/cachew のほかの issue

block/cachew の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。