PHP Web Push message issues

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.