Disabling Chrome buffering when streaming text data
Add X-Content-Type-Options: nosniff
to your headers and let me know how it goes for you.
According to Mozilla Docs:
The
X-Content-Type-Options
response HTTP header is a marker used by the server to indicate that the MIME types advertised in theContent-Type
headers should not be changed and be followed. This allows to opt-out of MIME type sniffing, or, in other words, it is a way to say that the webmasters knew what they were doing.
Try switching your Content-Type
from text/plain
to application/octet-stream
.
Check this out, for further reading:
Do I need Content-Type: application/octet-stream for file download?
This fix worked perfectly for me. I had the same issue you're describing, where sending small text chunks encoded as text/plain; charset=UTF-8
caused a delay in Chrome, but not in Firefox. Changing the type to application/octet resolved the issue on Chrome without effecting FireFox performance.