Html5-php + js how to implement push function

Source: Internet
Author: User
There are now two requirements for comet: 1. There are new users asking questions, the web interface automatically pops up a question. 2. The number of questions under a tag increases by 1. The total number of web interface tags is automatically increased by 1. In fact, it does not take into account the server pressure. without too much consideration for compatibility, how to press the server... is comet.

There are two requirements to implement

1. When a new user asks a question, a question is automatically displayed on the web interface.
2. The number of problems under a tag increases by 1. The total number of web interface tags is automatically increased by 1.

In fact, you can do it without considering the server pressure.
How to minimize the server pressure without too much consideration for compatibility
Html5 available

Reply content:

Is comet.

There are two requirements to implement

1. When a new user asks a question, a question is automatically displayed on the web interface.
2. The number of problems under a tag increases by 1. The total number of web interface tags is automatically increased by 1.

In fact, you can do it without considering the server pressure.
How to minimize the server pressure without too much consideration for compatibility
Html5 available

PHP web message push framework

Ready-made open-source products can be used directly and are easy to use.
Based on websocket, it is automatically converted to comet when websocket is not supported, non-round training, good performance
Demo: click here to view the web message push demo

Currently, I have tried two websocket-based frameworks, swoole and workerman. You can also try them.

Websocket

The segmentfault notification is that the webpage client initiates a request every minute to pull data.

The idea of a project is to pull data once each time a user initiates a GET or POST request.

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.