Search code examples
phpbandwidth

Testing website bandwidth


I would like to make a script that boosts my website's bandwidth to check the monthly allowance is working correctly.

<?php
for($i=0;$i>2000$i++) {
  //largest jpg on the website
  file_put_contents("tmp.jpg", file_get_contents("http://someurl/tmp.jpg"));
  unlink("tmp.jpg");
}
?>

Would the above code work in the way I would like it too or because it's the same file, does the server not 'download' it again?


Solution

  • According to the second post here, file_get_contents does not cache PHP files. I have no reason to think it should.