Jump to content

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


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);
}
?>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.