我想知道一些关于firebug的事情,当我试图用firebug opend加载一个页面时,它启动了时间线。
什么是:
正在等待、正在接收、DomContentLoaded、加载
mysql查询列表中有什么影响?我看到我添加了更多的mysql查询,接收部分也在增加。
让我粘贴一个请求,我已经在我的核心上使用,以生成动态链接或内容。
function getContent($id = '') {
$id = mysql_real_escape_string ($id);
$sql = 'SELECT id,post_title,post_content FROM wp_posts WHERE post_category="67" ORDER BY post_date DESC LIMIT 1';
$res = mysql_query($sql) or die (mysql_error());
if (mysql_num_rows($res) !=0):
while ($row = mysql_fetch_assoc($res)) {
// this remove caption from wordpress, get 450 words to be used for exerpt, encode html,
$mycontent = $row['post_content'];
$mycontent = strip_tags($mycontent);
$mycontent = substr($mycontent,0,250);
$mycontent = preg_replace("/\[caption.*\[\/caption\]/", '', $mycontent);
$mycontent = htmlentities($mycontent);
//encode the words for html
$title = $row['post_title'];
$title = htmlentities($title);
echo '
<<h1><a href="single.php?id='.$row['id'].'">'.$title.'</a> </h1>
<div class="cssclass"> '.$mycontent.' </div>
'; //echo
}
else:
echo 'This page dosnt exist.';
endif;
} // end 这段代码有没有什么错误或者正常,我的数据库大约有75.000行。
感谢您阅读这篇文章。
发布于 2011-08-13 02:13:03
等待:向服务器发送请求后,这是等待数据开始返回所花费的时间
接收:接收内容所花费的时间
DomContentLoaded:在整个DOM可用之前所花费的时间(注意,这并不是所有加载的资源,只是html部分,例如</html>标记已经被接收/处理)。
load:接收/处理/加载整个页面之前的时间,包括图像/脚本/css。
不要担心接收部分的增加。您正在输出更多数据,因此接收数据需要更多时间。这是非常正常的。
发布于 2011-08-13 02:15:31
等待是从浏览器发送请求到从服务器接收任何数据之间的时间。
接收是实际获取数据的时间。
接收更长的原因是因为你发送了更多的数据,所以下载需要更长的时间。您可能认为等待时间也会略有增加,但通过网络传输数据的时间比在服务器上处理数据所花费的时间更重要。
https://stackoverflow.com/questions/7044403
复制相似问题