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.