Range + If-Range support, end-to-end
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- go
- 领域
- api, backend, infrastructure
调研方向
从 internal/strategy/apiv1.go 和 internal/cache/api.go 开始,然后检查 s3_parallel_get.go 以及 disk、memory、tiered 和 remote 后端,以了解现有的读取路径。跟踪 client/ 和 remote 的连接逻辑,了解 Range 和 If-Range 的处理。完成的标准是:每个后端都能在返回 206 和 Content-Range 的同时返回正确的范围字节,过期的 If-Range 返回 200,而无法满足的范围返回 416。
由索引模型根据 Issue 内容生成。
描述
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) doesio.Copy(w, cr)— always200, never honoursRange, never setsAccept-Ranges, never returns206/Content-Range/416.- The
cache.Cacheinterface (internal/cache/api.go) only exposes a whole-objectOpenreturning anio.ReadCloser; there is no partial-read / seek capability. Only the disk backend reader happens to be seekable. checkConditionalsdoes not evaluateIf-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, sees3_parallel_get.go),tiered, andremote. - Implement server-side range handling in
apiv1.getObject: parseRange, emitAccept-Ranges: bytes, return206withContent-Rangefor satisfiable ranges and416for unsatisfiable ones. - Evaluate
If-Range(against the strong ETag; fall back to full200when the validator does not match) before serving a partial response. - Plumb
Range/If-Rangethrough 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
- 星标
- 42
- 派生
- 15
- 平均合并
- 4 小时 23 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
block/cachew 的其他 Issue
-
etag-range-followup
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 5/5 一周以上 新手友好度 30/100
-
难度 5/5 一周以上 新手友好度 38/100
-
Avoid exposing Git credentials in subprocess command-line arguments可能已有人在做 @bcho 于 75 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 56/100
-
难度 5/5 一周以上 新手友好度 25/100
相似的 Issue
-
goose sub-agent runs are never indexed: blame finds no session for any file a `delegate` child wrote未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 86/100
wakatime/wakatime-cli#1649 ·
维护者通常 1 天内回复
-
PathBuffer.Pop corrupts later error locations when a key contains "." or "["可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
danielgtaylor/huma#1135 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
stacklok/toolhive-catalog#1734 ·
维护者通常 1 天内回复
-
documentation priority:p1
难度 2/5 1-3 小时 新手友好度 78/100
yeixio/toskar-core#697 ·
维护者通常 1 天内回复