#Having issues with Server Sent Events (SSE) messages from Laravel getting sent all at once

2 messages · Page 1 of 1 (latest)

open marten
#

So I am trying to make an API that does something while giving progress updates to the client through SSE. But for some reason the messages are getting sent all at once at the end. The time column in the browser's EventStream tab shows that all the messages were received all at once, while the time in the data column correctly shows the time it was supposed to be sent.

For some info I'm on Windows using Laragon Full 6.0 220916 with PHP-8.4.3-nts-Win32-vs17-x64 and Apache httpd-2.4.63-250207-win64-VS17. The project is a Laravel Breeze project with ReactJS

Here is the code:
Laravel controller
https://pastebin.com/9P4ihrJK

js frontend
https://pastebin.com/xE7YwA0L

I have messed with it a bunch but this is the current state of the virtualhost
https://pastebin.com/y25d1w69

this screenshot shows that the time contained in the data shows the actual time it was sent, but the time column shows the received time which is all within a few ms

misty furnace
#

What helped me was settings the proxy buffer to off in the ngnix configuration. But then when there are a long streams i got a cut on connection and i tried Laravel Octane becuase PHP-FPM is not good for SSE. it worked. but i dont know if this is the way it meant to be developed or implemented in Laravel.