Skip to content

add content-length to streamed file downloads for browsers / progress - #3415

Open
syphar wants to merge 1 commit into
rust-lang:mainfrom
syphar:content-length
Open

add content-length to streamed file downloads for browsers / progress#3415
syphar wants to merge 1 commit into
rust-lang:mainfrom
syphar:content-length

Conversation

@syphar

@syphar syphar commented Jul 23, 2026

Copy link
Copy Markdown
Member

This is mainly for our zip / json downloads. Right now, the browser can't show any download progress because we don't send a Content-Length header.

Thing is: we only know the original content length from S3, which becomes obsolete when we decompress the stream while serving it to the user.

But that doesn't matter for the zip / json downloads, since we use get_raw_stream, which doesn't do any decompression.

This was also a bug with our "don't cache big objects" logic, where we assumed that the S3 content length is also what we return to the user / the CDN.

@syphar syphar self-assigned this Jul 23, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jul 23, 2026
@syphar syphar changed the title add content-length to streamed file downloads for browsers / progress WIP :add content-length to streamed file downloads for browsers / progress Jul 23, 2026
@syphar
syphar force-pushed the content-length branch 2 times, most recently from 515eafb to 2b98ab4 Compare August 5, 2026 01:56
@syphar
syphar marked this pull request as ready for review August 5, 2026 02:02
@syphar
syphar requested a review from a team as a code owner August 5, 2026 02:02
@syphar syphar changed the title WIP :add content-length to streamed file downloads for browsers / progress add content-length to streamed file downloads for browsers / progress Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant