PHP Tutorial. Application Example 2

Source: Internet
Author: User
PHP-Push technology implements the refresh function Serverpush a period of time before the hot amp; ldquo; Push amp; rdquo; technology, but most of the information on the Internet is cgi, occasionally, I see such an introduction on a French website... PHP-Push technology for refresh

Server push is a very popular "push" technology some time ago. However, most of the information on the Internet is cgi. sometimes I see such an introduction on a French website. Unfortunately, I cannot understand French, I can only understand something in his program. now I will give you some examples to learn. It can be used for data transmission in chat rooms, news updates on websites, and various frequently updated pages.

Previously, we used to add tags to the page.

Or use the timeout + reload of javascript. However, the refresh method depends on the time settings, and the data cannot be transmitted continuously and the time is difficult to determine. The Server that uses Server push establishes a permanent connection with the client after the client makes a request, and then the Server will continuously push the data packets to the Server according to the client's requests. The latency that you don't notice will make you feel that the server's response and your request have reached the level of synchronization.

Let's take a look at the example and explain it again.

Img. php

 

This is a permanently executed page (with the network constantly) that constantly outputs the image content. The following is the called page ., Token changes ). Then you will see that the image on the called page is automatically updated.


Address:

Reprinted at will, but please attach the article address :-)

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.