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