HTTP response streaming in app platform (for SSE support)
R
Roger P
I'm trying to serve Server-Sent Events (SSE) using Flask on the DO App Platform, but instead of streaming, something on DO's side seems to be caching the entire response and only returning it in one big chunk. I've been trying and trying to debug, and finally found this page which seems to indicate it's not possible? https://www.digitalocean.com/community/questions/how-to-enable-http-response-streaming-in-the-app-platform
So I have to migrate off the app platform now I guess? Or am I missing something?
Anonymous
Also struggling with this, if anyone has figured a workaround would appreciate the help
EDIT:
Changing my endpoints to accept POST and changing my server response headers as below seems to be working for me for now!
'Content-Type': 'text/event-stream',
'Connection': 'keep-alive',
'Cache-Control': 'no-cache',
'X-Accel-Buffering': 'no'
Alex Cavazos
Anonymous Did you get it to work with GET requests?
Saleh Alzahrani
Open AI apps need this
F
Francesco
Next.js apps don't work properly without this feature enabled. +1
Jesse Garrison
same issue- any updates on a fix?
S
Scott M
I am having the same problem and it would be great if the App Platform properly supported SSE. Our SSE server works fine when I run it locally and on other platforms, but when it is run on your App Platform, the event responses are not sent each time they are written, but only as a huge chunk when the server ends the response stream. The server is also not detecting when the client ends the connection.
Anonymous
Scott M: Hi Scott. Regarding aborts - are you sure that DO is responsible for this? I had this issue as well just to figure out it was an issue with Next.js framework. Upgrading resolved the issue.