Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming response #16

Closed
The-EDev opened this issue Oct 18, 2020 · 5 comments · Fixed by #28
Closed

Streaming response #16

The-EDev opened this issue Oct 18, 2020 · 5 comments · Fixed by #28
Labels
feature Code based project improvement
Milestone

Comments

@The-EDev
Copy link
Member

The-EDev commented Oct 18, 2020

ipkn#169, ipkn#46, ipkn#37, ipkn#8

Seems to be the logical continuation of static file serving, because as far as I understand, the connection times out regardless of what's going on, so a large static file is extremely likely not to be sent fully.

@The-EDev
Copy link
Member Author

ipkn#294 is a possible solution, although the Transfer-encoding would probably still be required here.

@The-EDev The-EDev added the feature Code based project improvement label Oct 18, 2020
@The-EDev
Copy link
Member Author

The-EDev commented Oct 19, 2020

Testing (running Firefox with GPRS throttling and downloading a 4.4MB png) seems to show that timeouts arent an issue for set_static_file_info(), at least for the first 12 minutes.

although maybe the encoding header should be added.

@The-EDev
Copy link
Member Author

It could be helpful however to stream responses larger than a certain size (say 1MB) automatically, the code for streaming is already there for static files, and can be extended to include all responses automatically, what do you think @mrozigor?

@mrozigor
Copy link
Member

If we already have a solution for this - why not? And maybe add some switch during compile time/configuration file to switch between current version and proposed one?

@The-EDev
Copy link
Member Author

Update: it seems chunked transfer is not exactly a part of the way we stream static files, but rather a different method altogether, according to MDN, chunked transfer ignores the content-size header, which could mean that the client will need to take data without knowing the size of that data, until a stop chunk is sent.

In all honesty i don't know whether to send content-size and stream the response or use Transfer-Encoding = Chunked and remove Content-Size

@The-EDev The-EDev added this to the 0.2 milestone Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Code based project improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants