We are trying to create a new website, and when i write the link of my website on the browser
ex: http://www.mywebsite.com, the waiting time is a bit high.
I have seen some website that has a lower waiting time then mine, is any way to decrease the waiting time , also we are using memcached for the website?
PS: idk exactly how is called, but i see it with firebug, and it says waiting time.
Thank you.
EDITED
This is the codes i have used to get data from database:
function f3($id = '') {
$id = mysql_real_escape_string ($id);
$sql = 'SELECT id,post_title,post_content,post_date,post_status,term_taxonomy_id,object_id FROM wp_posts, wp_term_relationships WHERE term_taxonomy_id = 60 AND post_status = "publish" AND wp_term_relationships.object_id = id ORDER BY post_date DESC LIMIT 1 OFFSET 2';
$res = mysql_query($sql) or die (mysql_error());
if (mysql_num_rows($res) !=0):
$row = mysql_fetch_assoc($res);
$mycontent = $row['post_content'];
$mycontent = strip_tags($mycontent);
$mycontent = substr($mycontent,0,150);
$mycontent = preg_replace("/\[caption.*\[\/caption\]/", '', $mycontent);
$title = AvinD($row['post_title']);
$old_date = $row['post_date']; // returns Saturday, January 30 10 02:06:34
$old_date_timestamp = strtotime($old_date);
$new_date = date('d.m.Y H:i', $old_date_timestamp);
$first_img = '';
$my1content = AvinD($row['post_content']);
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $my1content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "/img/default.png";
}
echo '
'.$new_date.'
<a href="single.php?id='.$row['id'].'"> '.$title.' </a> </div>
<a href="single.php?id='.$row['id'].'"> <img src="timthumb.php?src='.$first_img.'&h=107&w=190amp;zc=1" alt="" /> </a> </div>
'.$mycontent.'
'; //echo
else:
echo 'Page dont exist';
endif;
} // end
Well a number of different factors can affect your page load time. The three biggest being:
Without having more details about your website, I’ll briefly describe how to diagnose and fix these three big problems. If you provide your website link in a comment on this answer I can be more specific.
Server Lag
This happens when you try to connect to your website, and it hangs for a while connecting. Moreover this can have a blank white page which spins for a while, then finally begins to load your content.
You cannot fix this on your own other than switching hosts, or working with your host to increase your bandwidth and server connection.
Content Overload
The best example of this is when you see someone put tons of images on one page. Keep in mind that every image you add requires the user to download this image before the page is loaded. This includes those in
<img>tags as well asbackground-imagees.Poor Programming
A symptom of this would be similar to server lag, where you have to wait a while before content begins to load. This can result from a number of things, from a slow Database connection to multiple nested loops. Very difficult to diagnose without looking at the full code.