marjanristicevic's avatar

Continuous page update

I use custom dto object and json monolog formatter to gather data application is constantly producing and want to display that on web panel. I know this could be done on a lot of ways but not sure which is the standard one. Should I use blade templates, or javascript templating, and for live update scheduled ajax, I need pagination also...

As this is not rare use case I guess there are already built libs (angular or react components) I could use guidance which libs to chose?

0 likes
3 replies
Snapey's avatar
Snapey
Best Answer
Level 122

The main techniques are ajax long poll, or web sockets like pusher.

Laravel has support for broadcasting out of the box, and is boosted in laravel 5.3

Long polling is a client technique so the laravel application does not need to do anything special.

See top answer for comparison http://stackoverflow.com/questions/10028770/in-what-situations-would-ajax-long-short-polling-be-preferred-over-html5-websock

and

http://stackoverflow.com/questions/11077857/what-are-long-polling-websockets-server-sent-events-sse-and-comet

2 likes
d3xt3r's avatar

Long polling is a client technique ...

Beg to differ. Client does nothing special but to send the request, server holds the request until an information is available ...

Snapey's avatar

Client does nothing special but to send the request, server holds the request until an information is available ...

yes, of course, sorry @d3xt3r . I was thinking about the approach of regular ajax call on a timer.

Please or to participate in this conversation.