Is there another way to create a connection stream between a loaded page (client) and the server without using repeated AJAX calls, like every half second? I think of something that will make the client listening until the server gives a response (which can take a few seconds to arrive).
Thank you for your answers.
I would like to recommd you Phil Leggetter's Guide to Real-time technologies - because that is what you are looking for.
You will need one of the html5 introduced connection aspects: WebSockets, Server-Sent Events or even WebRTC DataChannel could be possible if you have a peer-to-peer use case.
Server-sent-events do have more server-side compatibilitly, technically it is more like optimized HTTP streaming, you can read more details in the spec and on caniuse. If you need a constant bidirectional connection and better client side support you better go with WebSockets. But you will need to set up a compatible server or use an external service like Pusher or Firebase.