. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform
I have the same question. I use in JavaScript EventSource() with response from php as "text/event-stream" and offline in my XAMPP all working fine. Online its not working, its pending and and all replies return at end.
My test case:
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
header('Connection: keep-alive');
header('X-Accel-Buffering: no');
while (ob_get_level() > 0) {
ob_end_flush();
if (function_exists('apache_setenv')) {
@apache_setenv('no-gzip', '1');
@ini_set('zlib.output_compression', 'Off');
@ini_set('output_buffering', 'Off');
@ini_set('implicit_flush', 'On');
$counter = 0;
while (true) {
if (connection_aborted()) {
break;
$curDate = date(DATE_ISO8601);
echo "event: ping\n";
echo "data: {\"time\": \"{$curDate}\", \"count\": {$counter}}\n\n";
while (ob_get_level() > 0) {
ob_end_flush();
flush();
$counter++;
if ($counter > 2) {
break;
sleep(2);
and in command-line I call
# curl -vN
https://www.example.com/test.php
It will only display all outputs once it has run through completely.
I tried nginx setting
add_header Cache-Control no-cache;
add_header Content-Type text/event-stream;
add_header Alt-Svc 'h2=":443"; ma=0';
proxy_read_timeout 610s;
proxy_send_timeout 610s;
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
not helps. I add for apache:
This did not help either.
What do you have to do here so that a certain script works on the domain with Content-Type: text/event-stream?
Does anyone have experience with this and can help me (and Ultaschall4D)?