Jump to content

try to get website speed, but i can read only ''domain.com'' i can't read files like css , js why?


novtu89

Recommended Posts

Hello,


I try to get website speed of some website, but i can read only ''domain.com'' i can't read website files like css , js ... why ? i use proxies for this job.


here is the php code:



$options = array(
'useragent' => "Firefox (+http://www.firefox.org)", // who am i
'connecttimeout' => 120, // timeout on connect
'timeout' => 120, // timeout on response
'redirect' => 10, // stop after 10 redirects
'referer' => "http://www.google.com",
'proxyhost' =>'85.25.8.14:80'
);
$response = http_get("http://solve-ict.com/wp-content/themes/ict%20theme/js/jquery-1.7.1.min.js", $options , $info);

but it works fine with http://domain.com/ , but with files css or js it gives 404, using some free proxy servers available


?


Thanks.


No idea why, but if just need the speed of the connection transfer can use this

 

I would use curl for the connection.

Do you really want a 120 second timeout?

<?php
$url ="http://solve-ict.com/wp-content/themes/ict%20theme/js/jquery-1.7.1.min.js";
    $start_request = microtime(true);
    $data = @file_get_contents($url);
    $end_request = microtime(true);
if(!$data){
    echo 'Timed Out';
} else {
    echo $time_taken = round(($end_request - $start_request),2);
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.