Stream zip downloads to the browser #10935

Closed
opened 2025-11-02 09:22:33 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @SZEINER on GitHub (May 30, 2023).

Description

After choosing the method to download zip, tar.gz, nothing happens for larger projects and it looks like the preparation took a long time.

Gitea Version

1.19.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

1.19.3

Operating System

Windows 10

How are you running Gitea?

Runing under instance

Database

MySQL

Originally created by @SZEINER on GitHub (May 30, 2023). ### Description After choosing the method to download zip, tar.gz, nothing happens for larger projects and it looks like the preparation took a long time. ### Gitea Version 1.19.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 1.19.3 ### Operating System Windows 10 ### How are you running Gitea? Runing under instance ### Database MySQL
GiteaMirror added the type/enhancementissue/confirmed labels 2025-11-02 09:22:33 -06:00
Author
Owner

@silverwind commented on GitHub (May 31, 2023):

I think the operation can be improved to immediately deliver a response with transfer-encoding: chunked and "pipe" the data stream into the response. That will give instantaneous reaction in the browser, at the cost that the browser can no longer show a progress bar on the download because final size is not yet determined.

@silverwind commented on GitHub (May 31, 2023): I think the operation can be improved to immediately deliver a response with `transfer-encoding: chunked` and "pipe" the data stream into the response. That will give instantaneous reaction in the browser, at the cost that the browser can no longer show a progress bar on the download because final size is not yet determined.
Author
Owner

@silverwind commented on GitHub (May 31, 2023):

Note, I'm not sure if transfer-encoding: chunked is the right way, Wikipedia says HTTP2 does not support it. But the basic idea is the same, don't set a content-size and immediately start delivering bytes while the zipping is still in-progress on the server.

@silverwind commented on GitHub (May 31, 2023): Note, I'm not sure if `transfer-encoding: chunked` is the right way, [Wikipedia](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) says HTTP2 does not support it. But the basic idea is the same, don't set a `content-size` and immediately start delivering bytes while the zipping is still in-progress on the server.
Author
Owner

@SZEINER commented on GitHub (Jun 3, 2023):

I think the operation can be improved to immediately deliver a response with transfer-encoding: chunked and "pipe" the data stream into the response. That will give instantaneous reaction in the browser, at the cost that the browser can no longer show a progress bar on the download because final size is not yet determined.

That is great idea how fix that.

@SZEINER commented on GitHub (Jun 3, 2023): > I think the operation can be improved to immediately deliver a response with `transfer-encoding: chunked` and "pipe" the data stream into the response. That will give instantaneous reaction in the browser, at the cost that the browser can no longer show a progress bar on the download because final size is not yet determined. That is great idea how fix that.
Author
Owner

@silverwind commented on GitHub (Sep 19, 2025):

Fixed with https://github.com/go-gitea/gitea/pull/35487.

@silverwind commented on GitHub (Sep 19, 2025): Fixed with https://github.com/go-gitea/gitea/pull/35487.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10935