Replies: 2 comments
-
Hello, There is an example about serving a big html fie using a small buffer and with caching headers here: |
Beta Was this translation helpful? Give feedback.
-
If it was really streaming, its API should have been like that:
and the callback as seen in the link above would then read the stream and fill the chunk buffer. Note: this is nearly what You have:
very confusing... ;-) |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to use AsyncResponseStream similarly to what I do with a Serial stream. I need to send several 10th of kilobytes in binary and I have heap size issue.
Since a bufferSize is specified, I had initially understood that it would push data to the client progressively and maybe block the writes to slow down like Serial do (i think).
I then noticed that the content-length was set on the response and since headers should be sent before the body, I understood that it was entirely buffered and not sent like a stream.
I then used .availableForWrite to prevent filling the buffer but it seems not implemented.
From user POV, what is the purpose of bufferSize here and how could send the response progressively, maybe by specifying the content length before and using another async response type ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions