Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: HTML5, SSE, flush output '$| = 1' not working as expected

by ehaase (Initiate)
on Sep 04, 2015 at 14:18 UTC ( [id://1141010]=note: print w/replies, xml ) Need Help??


in reply to Re: HTML5, SSE, flush output '$| = 1' not working as expected
in thread HTML5, SSE, flush output '$| = 1' not working as expected

'In general' means, that the tickers are sent to the client and the client (Browser) receives the data. But all single updates are shown together at the end of the scripts instead of flushing each single ticker. The expected result is an update every second of one of the ticker symbols.

  • Comment on Re^2: HTML5, SSE, flush output '$| = 1' not working as expected

Replies are listed 'Best First'.
Re^3: HTML5, SSE, flush output '$| = 1' not working as expected
by Anonymous Monk on Sep 04, 2015 at 23:30 UTC

    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

      Were you able to get this resolved?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1141010]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found