Which of the following is the speed for redirecting from header to file_get_contents?

Source: Internet
Author: User
Which of the following is faster than header redirection and file_get_contents? Whether it is display or download, it is to compare their speed. I won't, please call everyone. Method 1: header (url address); exit (); Method 2: echo & nbsp; @ file_get_cont header jump and file_get_contents. which one is faster?
Whether it is display or download, it is to compare their speed. I won't, please call everyone.

Method 1:
Header (url address );
Exit ();

Method 2:
Echo @ file_get_contents (url address );
Exit (); header file_get_contents
------ Solution --------------------
Get the target page with file_get_contents on the server and send it to the user
It is equivalent to using a proxy to access the target page on the client.

As for who is fast and slow, field tests are required.

------ Solution --------------------
Reference:
Reference: reference: get the target page with file_get_contents on the server and send it to the user.
It is equivalent to using a proxy to access the target page on the client.

As for who is fast and slow, field tests are required.
How should I test it? No ......
Each method loops 100 times to see which time is used. of course, the two tests must be tested at intervals, otherwise there will be errors.
......

It is best to restart the machine or clear the memory. Otherwise, the memory occupied by the previous test will affect the result of the next Test.
------ Solution --------------------
There are too many external factors. The nature is different. the header access tests the response time from the client to the server. file_get_contents tests the response time from the client to the server to the source file server, this kind of things can't be determined, but can only be analyzed.

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.