PHP Web Push message issues
Systems for internal use
I use long polling to push messages the whole site is slow
There's no way out.
Reply to discussion (solution)
Many websites use polling is not very slow AH can be slightly specific description of how slow? The size of the frequency value of polling words
The data is refreshed periodically via AJAX push.
Many websites use polling is not very slow AH can be slightly specific description of how slow? The size of the frequency value of polling words
Private はあなたを?して
Many websites use polling is not very slow AH can be slightly specific description of how slow? The size of the frequency value of polling words
Private はあなたを?して
Shame ずかしい ...
This is a PHP implementation of the WebSocket server-side
Https://github.com/cboden/Ratchet
Simply, the client periodically sends a message to the server. The heartbeat is good. There is no need for long polling, internal use.
Ajax is much better than push, you can try
The general use of Ajax polling is possible
If you feel slow, please check if your algorithm is appropriate (polling frequency is too high, repeat calculation is too much per round, etc.)
Server push is required by the client and the service side have the appropriate technical support
HTTP protocol-based server push, only Netscape browser support, but the browser is still out of the history stage
Server push based on Websock protocol, the client is a browser that supports HTML5, the service side is usually node. js
PHP does not have the relevant components, if implemented in code, there is no practical value
Besides, now with the upgrade of HTML5 browser. Sample code that can be searched online, without exception, does not work properly