Try printing headers using CGI, for example
use CGI qw//;
my $q = CGI->new();
print $q->header(
-nph => 0,
'Content-Type' => ' text/event-stream',
'Cache-Control' => 'no-cache',
'Connection' => ' keep-alive',
);
print $q->header(
-nph => 1,
'Content-Type' => ' text/event-stream',
'Cache-Control' => 'no-cache',
'Connection' => ' keep-alive',
);
__END__
Cache-control: no-cache
Connection: keep-alive
Content-Type: text/event-stream; charset=ISO-8859-1
HTTP/1.0 200 OK
Server: cmdline
Date: Fri, 04 Sep 2015 23:33:29 GMT
Cache-control: no-cache
Connection: keep-alive
Content-Type: text/event-stream; charset=ISO-8859-1
Do you see the difference? Without nph off, apache is going to fill in the missing headers
With nph on, apache is not touching the headers .... and probably not buffering |