Range-Requests As A Remote Binary-Search Primitive Over Large Static Files
Sources: 1 • Confidence: High • Updated: 2026-04-12 10:09
Key takeaways
- The demo accepts either a single character or a hexadecimal Unicode codepoint input and displays the intermediate steps of the binary search through the large file.
- HTTP Range-request techniques are not compatible with HTTP compression because compression breaks byte-offset calculations.
- The tool was deployed to tools.simonwillison.net and queries a CORS-enabled 76.6MB file hosted in S3 and fronted by Cloudflare using Range requests.
- Claude was used to generate a specification and Claude Code for web was used to turn it into working code via an asynchronous research workflow.
- A prototype was built from a phone as an experiment in using HTTP Range requests.
Sections
Range-Requests As A Remote Binary-Search Primitive Over Large Static Files
- The demo accepts either a single character or a hexadecimal Unicode codepoint input and displays the intermediate steps of the binary search through the large file.
- A prototype was built from a phone as an experiment in using HTTP Range requests.
- The prototype searches a large file by performing a binary search implemented via HTTP Range requests.
- A proposed use case for the approach is looking up Unicode codepoint metadata by searching through many megabytes of data.
- This Range-request binary-search approach requires data that is naturally sorted to be useful.
Correctness Constraint: Range Requests Require Stable Byte Offsets (No Http Compression)
- HTTP Range-request techniques are not compatible with HTTP compression because compression breaks byte-offset calculations.
Deployment Pattern: Browser-Accessible Partial Reads Against Cdn-Fronted Object Storage
- The tool was deployed to tools.simonwillison.net and queries a CORS-enabled 76.6MB file hosted in S3 and fronted by Cloudflare using Range requests.
Ai-Assisted Prototyping Workflow From Spec To Implementation
- Claude was used to generate a specification and Claude Code for web was used to turn it into working code via an asynchronous research workflow.
Unknowns
- What are the observed latency and request-count characteristics for typical lookups (e.g., number of Range requests per query, median/worst-case time)?
- What is the egress and CDN cost profile of repeated interactive queries against the 76.6MB file (including cache hit rates and byte-transfer per query)?
- How is HTTP compression practically handled end-to-end (origin, CDN, browser) to guarantee stable byte offsets for Range responses?
- What file format and record layout is used to make binary search feasible (e.g., fixed-width records vs variable-length lines), and what are the failure modes when records are variable-length?
- What cross-browser and CDN interoperability issues were encountered (Range semantics, CORS edge cases, caching behavior), if any?