PHP web message push
Internal systems
I use long polling to push messages. the whole website is very slow.
Is there a solution?
Reply to discussion (solution)
Many websites are not slow when polling is used. how can this problem be described in detail? The value of the frequency pass-through in polling
Push through ajax to regularly refresh data.
Many websites are not slow when polling is used. how can this problem be described in detail? The value of the frequency pass-through in polling
What are the private keys? Zookeeper
Many websites are not slow when polling is used. how can this problem be described in detail? The value of the frequency pass-through in polling
What are the private keys? Zookeeper
Shame...
This is a websocket server implemented by php.
Https://github.com/cboden/Ratchet
In short, the client regularly sends messages to the server. Heartbeat is good. Long polling is not required for internal use.
Ajax is much better than push. you can try it.
Generally, ajax round-robin is enough.
If you feel the speed is slow, check whether your algorithm is suitable (the polling frequency is too high, and there are too many repeated computations in each round)
Server pushing requires technical support from both the client and server.
Http-based server pushing is only supported by the netscape browser, but the browser is still out of the historical stage.
Server pushing based on the websock protocol. the client supports HTML5 browsers, and the server is generally Node. js.
Php does not have related components. if it is implemented using code, it has no practical value.
Besides, the HTML5 browser is being upgraded. The sample code that can be searched on the Internet cannot work without exception.