Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Mojolicious refresh

by jo37 (Deacon)
on Mar 18, 2020 at 22:10 UTC ( [id://11114445]=note: print w/replies, xml ) Need Help??


in reply to Re: Mojolicious refresh
in thread Mojolicious refresh

A more advanced technique consists in a client side framework like Angular where the page's content depends on some JS variables and is automatically refreshed whenever a variable's value changes. These changes may be pushed to the client via web sockets. This way page updates are minimal, smooth and happen immediately.

Implementing this using Mojolicious::Lite on the server side is pretty easy. The real work has to be done on the client.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re^3: Mojolicious refresh
by LanX (Saint) on Mar 18, 2020 at 23:21 UTC
    > A more advanced technique consists in a client side framework like Angular

    I always thought that the benefit of Web sockets was that the action can be initiated from the server.

    I don't see the big difference to the AJAX/DOM point I listed.

    Or what's the advancement here?

    Speed?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      Avoid polling. Changed content is pushed to the client. This is AJAX based anyway.

      Greetings,
      -jo

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

        I think it would be fantastic to see some demo code for that here.

        > Avoid polling. Changed content is pushed to the client.

        Sure, but again:

        what for would one want this? Speed?

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found