koalabruder
koalabruder

Reputation: 2904

Is my HTTP-Server able to detect the connection speed of the Client?

Is it possible to measure the download speed of the Client with a script running on the server (HTTP)?

How can I interpret the logged time of the following PHP-Script?

header("Content-Type: plain/text");
header("Content-Disposition: Attachment; filename=test.txt");
header('Content-Length: ' . 5);
header("Pragma: no-cache");

$start=microtime(true); // Start 
echo "abcde";

log(microtime(true)-$start); // End + log
exit();

Upvotes: 0

Views: 394

Answers (1)

DaveyBoy
DaveyBoy

Reputation: 2915

You script would give you the execution time of the script on the server. PHP is parsed server side and transmitted to the client. Therefore, the server would calculate the time to prepare "abcde" to transmit to the client.

If you want to measure link speed, you're going to need client side code to do this. Unfortunately, I don't have any code I can suggest

Upvotes: 1

Related Questions