<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[SEO搜索引擎优化天空]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[seo优化包括很多内容,css  html  javascript的优化策略也是其中的一部分------逆风的方向，更适合飞翔]]></description>
<link>http://hi.baidu.com/seosky</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[如何打印指定的页面？]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/60f5978f91d75ee4f01f36dd.html]]></link>
        <description><![CDATA[
		
		有没有遇到过在这个页面上点击一个按钮，去打印另一个页面的问？比如：有一个页面a.html，现在我希望在页面a.html中点击按钮，打印b页面，b页面完整的路径是：http://www.yslow.net/show.php?tid=123 <br>
<br>
<strong>实现1：</strong><br>
<br>
&lt;b<a target="_blank" href="http://www.soidc.net/search_tech.shtml?wo=ut" class="common">ut</a>ton &#160; onclick=&quot;eyun()&quot;&gt;Print&lt;/button&gt; &#160; <br>
&lt;script&gt; &#160; <br>
function &#160; eyun() &#160; <br>
{var &#160; nw=window.open(&quot;http://www.yslow.net/show.php?tid=123&quot;); &#160; <br>
nw.print(); &#160; <br>
nw.close(); &#160; <br>
} &#160; <br>
&lt;/script&gt; &#160; <br>
<br>
注意：一定要同域，否则没有权限 &#160; &#160; <br>
<br>
<strong>实现2：</strong><br>
<br>
可以跨域的.. &#160; <br>
<br>
&lt;body&gt; &#160; &#160; <br>
&lt;inp<a target="_blank" href="http://www.soidc.net/search_tech.shtml?wo=ut" class="common">ut</a> &#160; onclick='prn()' &#160; type=button &#160; value=print_Iframe&gt;&lt;br&gt; &#160; <br>
&lt;input &#160; type=text &#160; value=&quot;http://www.baidu.com&quot;&gt;&lt;br&gt; &#160; &#160; <br>
&lt;iframe &#160; id=mxh &#160; src=&quot;PrintPage.htm&quot; &#160; style=&quot;width:0;height:0&quot;&gt;&lt;/iframe&gt; &#160; &#160; <br>
&lt;script&gt; &#160; &#160; <br>
function &#160; prn() &#160; &#160; <br>
{ &#160; &#160; <br>
var &#160; win=window.open(document.all.mxh.src &#160; ) &#160; &#160; <br>
win.moveTo(1200,1200) &#160; &#160; <br>
win.print(); &#160; <br>
win.close(); &#160; <br>
} &#160; &#160; <br>
&lt;/script&gt;          <br>
<br> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/Javascript">Javascript</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/60f5978f91d75ee4f01f36dd.html#comment">查看评论</a>]]></description>
        <pubDate>2009-11-24  16:48</pubDate>
        <category><![CDATA[Javascript]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/60f5978f91d75ee4f01f36dd.html</guid>
</item>

<item>
        <title><![CDATA[HttpWatch检测js加载四 Blocked（闭塞时间）长的问题]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/58c455092560f7a52eddd4e8.html]]></link>
        <description><![CDATA[
		
		是否遇到过测试一个网站页面元素加载速度时，js请求的blocked时间较长。如图：<br>
<br>
<img border="0" class="blogimg" small="0" src="http://hiphotos.baidu.com/seosky/pic/item/1e3b22e967845312b80e2dba.jpg"><br>
最常见的浏览器将阻止时，遇到一个脚本标记，因为浏览器不知道如果脚本是为其余的页面呈现需要。这就是为什么如果你是JavaScript您将得到不确定因素，即使元素的DOM。<br>
<br>
脚本阻挡在两个方面。<br>
<br>
*在页面资源是阻止下载，如果下面的脚本中。<br>
*元素被封锁，如果他们的渲染下的脚本中。<br>
<br>
上图显示此阻塞。现在大多数浏览器都维持在2并行下载的时间和大部分开发商将在与脚本标记头所有JavaScript，这意味着，当浏览器看到它启动脚本标记下载这些并没有做任何事情，直到它们被下载。<br>
<br>
<strong>资料地址:</strong><br>
<br>
找到三个参考信息<br>
<br>
http://yuiblog.com/blog/2008/07/22/non-blocking-scripts/<br>
<br>
http://www.artzstudio.com/2008/07/beating-blocking-javascript-asynchronous-js/<br>
<br>
http://www.mattjezorek.com/performance/javascript/decrease-webpage-load-time-nonblocking-javascript/<br>
<br>
转载请著名出处：<br>
转载于：<a href="http://www.yslow.net/" target="_blank">web前端优化</a><br> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/%CD%F8%D5%BE%C7%B0%B6%CB%D0%D4%C4%DC%D3%C5%BB%AF">网站前端性能优化</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/58c455092560f7a52eddd4e8.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  16:48</pubDate>
        <category><![CDATA[网站前端性能优化]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/58c455092560f7a52eddd4e8.html</guid>
</item>

<item>
        <title><![CDATA[Web测试工具－常用辅助测试工具介绍]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/2f1a7f60a1ae05d58db10d58.html]]></link>
        <description><![CDATA[
		
		<p>Web测试常用辅助测试工具介绍<br>
<br>
<br>
以前做电子商务和电子支付测试时,常用到的Web测试辅助工具,希望对大家有所帮助<br>
1 Xenu Link Sleuth<br>
&ldquo;Xenu链接检测侦探&rdquo;是被广泛使用的死链接检测工具。可以检测到网页中的普通链接、图片、框架、插件、背景、样式表、脚本和java 程序中的链接。该工具需要下载安装，不能在线检测，总体上具有以下特色：<br>
简单的用户界面<br>
重新检查死链接功能（避免有的死链接属于暂时性无效）<br>
报告格式简单，可通过Email报告<br>
可执行文件小于1M<br>
支持SSL网站(https://)<br>
侦测到重定向URL<br>
制作网站地图<br>
<br>
<br>
2 免费在线链接检查工具<br>
http://validator.w3.org/checklink<br>
W3C Link Checker<br>
<br>
<br>
3 Web测试辅助工具之微软Internet Explorer Developer Toolbar<br>
简介：主要是基于IE下的一个插件，提供的功能如下：<br>
<br>
浏览和修改Web页的文档对象模型（DOM）。<br>
通过多种技术方式定位、选定Web页上的特定元素。<br>
禁止或激活IE设置。<br>
查看HTML对象的类名、ID，以及类似链接路径、tab顺序、快捷键等细节。<br>
描绘表格、单元格、图片或选定标签的轮廓。<br>
显示图片象素、大小、路径、替代文字等。<br>
即时重定义浏览器窗口大小到800x600或自定义大小。<br>
清空浏览器缓存和cookie，被清除项可从所有对象或给定域中选择。<br>
直接访问关联W3C规范参考、IE开发组blog或其他来源。<br>
显示设计时标尺，帮助对齐对象。<br>
<br>
4 Web测试辅助工具之Mozilla Firefox插件<br>
<br>
1 Web Developer<br>
2 FireBug<br>
3 View Cookies或 Add &amp; Edit Cookies，<br>
4 Live HTTP Headers<br>
5 Aardvark<br>
6 其它工具，点击这，Mozilla Firefox官方下载<br>
<br>
备注：https://addons.mozilla.org/en-US/firefox/recommended<br>
<br>
<br>
5 HttpWatch工具简介及使用技巧<br>
<br>
HttpWatch强大的网页数据分析工具.集成在Internet Explorer工具栏.包括网页摘要.Cookies管理.缓存管理.消息头发送/接受.字符查询.POST 数据和目录管理功能.报告输出 HttpWatch 是一款能够收集并显示页页深层信息的软件。它不用代理服务器或一些复杂的网络监控工具，就能够在显示网页同时显示网页请求和回应的日志信息。甚至可以显示浏览器缓存和IE之间的交换信息。集成在Internet Explorer工具栏。<br>
<br>
下载地址:http://www.httpwatch.com/</p>
<p> </p>
<p>转载请著名出处：<br>
转载于：<a target="_blank" href="http://www.yslow.net/"><font color="#2f5fa1">web前端优化</font></a>&nbsp;&nbsp;<a href="http://www.yslow.net/show.php?tid=289">http://www.yslow.net/show.php?tid=289</a></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/2f1a7f60a1ae05d58db10d58.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  15:01</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/2f1a7f60a1ae05d58db10d58.html</guid>
</item>

<item>
        <title><![CDATA[Web测试指南（六）－接口测试]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/fe096c4a13a11d2909f7ef5f.html]]></link>
        <description><![CDATA[
		
		<span style="background: rgb(242, 248, 249) none repeat scroll 0% 0%; font-size: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; ">
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">6 </span><span style="font-size: 9pt; color: black; ">接口测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">在很多情况下，<span>web </span>站点不是孤立。<span>Web </span>站点可能会与外部服务器通讯，请求数据、验证数据或提交订单。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">6.1</span><span style="font-size: 9pt; color: black; ">服务器接口<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">第一个需要测试的接口是浏览器与服务器的接口。测试人员提交事务，然后查看服务器记录，并验证在浏览器上看到的正好是服务器上发生的。测试人员还可以查询数据库，确认事务数据已正确保存。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">这种测试可以归到功能测试中的表单测试和数据校验测试中<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">6.2&#160;</span><span style="font-size: 9pt; color: black; ">外部接口<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">有些<span> web </span>系统有外部接口。例如，网上商店可能要实时验证信用卡数据以减少欺诈行为的发生。测试的时候，要使用<span> web </span>接口发送一些事务数据，分别对有效信用卡、无效信用卡和被盗信用卡进行验证。如果商店只使用<span> Visa </span>卡和<span> Mastercard </span>卡，<span>&#160;</span>可以尝试使用<span> Discover </span>卡的数据。<span>(</span>简单的客户端脚本能够在提交事务之前对代码进行识别，例如<span> 3 </span>表示<span> American Express</span>，<span>4 </span>表示<span> Visa</span>，<span>5 </span>表示<span> Mastercard</span>，<span>6 </span>代表<span>Discover</span>。<span>)</span>通常，测试人员需要确认软件能够处理外部服务器返回的所有可能的消息。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">这种情况在远程抄表中可能会体现到<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">6.3&#160;</span><span style="font-size: 9pt; color: black; ">错误处理<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">最容易被测试人员忽略的地方是接口错误处理。通常我们试图确认系统能够处理所有错误，但却无法预期系统所有可能的错误。尝试在处理过程中中断事务，看看会发生什么情况？订单是否完成？尝试中断用户到服务器的网络连接。尝试中断<span> web </span>服务器到信用卡验证服务器的连接。在这些情况下，系统能否正确处理这些错误？是否已对信用卡进行收费？如果用户自己中断事务处理，在订单已保存而用户没有返回网站确认的时候，需要由客户代表致电用户进行订单确认。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">采取措施：在理解需求的基础上，充分发挥想象力，尽量比较全面的列出各种异常情况。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">&#160;</span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">7 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">结论<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">　<span><span>&#160; </span></span>无论你在测试<span> internet</span>、<span>intranet </span>或者是<span> extranet </span>应用程序，<span>web </span>测试相对于非<span> web </span>测试来说都是更具挑战性的工作。用户对<span> web </span>页面质量有很高的期望。在很多情况下，就像业务功能一样，页面用于维护和发展公共关系，所以第一印象非常重要。</span></p>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/fe096c4a13a11d2909f7ef5f.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  14:59</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/fe096c4a13a11d2909f7ef5f.html</guid>
</item>

<item>
        <title><![CDATA[Web测试指南（五）－安全测试]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/4e7f754e0f5c8a03b3de055e.html]]></link>
        <description><![CDATA[
		
		<span style="background: rgb(242, 248, 249) none repeat scroll 0% 0%; font-size: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; ">
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">5 </span><span style="font-size: 9pt; color: black; ">安全测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">即使站点不接受信用卡支付，安全问题也是非常重要的。<span>Web </span>站点收集的用户资料只能在公司内部使用。如果用户信息被黑客泄露，客户在进行交易时，就不会有安全感。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">5.1 </span><span style="font-size: 9pt; color: black; ">目录设置<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">Web </span><span style="font-size: 9pt; color: black; ">安全的第一步就是正确设置目录。每个目录下应该有<span> index.html </span>或<span> main.html </span>页面，这样就不会显示该目录下的所有内容。我服务的一个公司没有执行这条规则。我选中一幅图片，单击鼠标右键，找到该图片所在的路径<span>&quot;…com/objects/images&quot;</span>。然后在浏览器地址栏中手工输入该路径，发现该站点所有图片的列表。这可能没什么关系。我进入下一级目录<span> &quot;…com/objects&quot; </span>，点击<span> jackpot</span>。 在该目录下有很多资料，其中引起我注意的是已过期页面。该公司每个月都要更改产品价格，并且保存过期页面。我翻看了一下这些记录，就可以估计他们的边际利 润以及他们为了争取一个合同还有多大的降价空间。如果某个客户在谈判之前查看了这些信息，他们在谈判桌上肯定处于上风。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">5.2 SSL</span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">很多站点使用<span> SSL </span>进行安全传送。你知道你进入一个<span> SSL </span>站点是因为浏览器出现了警告消息，而且在地址栏中的<span> HTTP </span>变成<span> HTTPS</span>。如果开发部门使用了<span>SSL</span>，测试人员需要确定是否有相应的替代页面<span>(</span>适用于<span>3.0 </span>以下版本的浏览器，这些浏览器不支持<span>SSL</span>。当用户进入或离开安全站点的时候，请确认有相应的提示信息。是否有连接时间限制？超过限制时间后出现什么情况？<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">5.3 </span><span style="font-size: 9pt; color: black; ">登录<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">有些站点需要用户进行登录，以验证他们的身份。这样对用户是方便的，他们不需要每次都输入个人资料。你需要验证系统阻止非法的用户名<span>/</span>口令登录，而能够通过有效登录。用户登录是否有次数限制<span>? </span>是否限制从某些<span> IP </span>地址登录<span>? </span>如果允许登录失败的次数为<span>3</span>，你在第三次登录的时候输入正确的用户名和口令，能通过验证吗<span>? </span>口令选择有规则限制吗<span>? &#160;</span></span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">是否可以不登陆而直接浏览某个页面？<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">Web</span><span style="font-size: 9pt; color: black; ">应用系统是否有超时的限制，也就是说，用户登陆后在一定时间内（例如<span>15</span>分钟）没有点击任何页面，是否需要重新登陆才能正常使用。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">5.4 </span><span style="font-size: 9pt; color: black; ">日志文件<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">在后台，要注意验证服务器日志工作正常。日志是否记所有的事务处理<span>? </span>是否记录失败的注册企图<span>? </span>是否记录被盗信用卡的使用<span>? </span>是否在每次事务完成的时候都进行保存<span>? </span>记录<span>IP </span>地址吗<span>? </span>记录用户名吗<span>?</span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">5.5 </span><span style="font-size: 9pt; color: black; ">脚本语言<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">脚本语言是常见的安全隐患。每种语言的细节有所不同。有些脚本允许访问根目录。其他只允许访问邮件服务器，但是经验丰富的黑客可以将服务器用户名和口令发送给他们自己。找出站点使用了哪些脚本语言，并研究该语言的缺陷。</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">还要需要测试没有经过授权，就不能在服务器端放置和编辑脚本的问题。</span><span style="font-size: 9pt; color: red; ">最好的办法是订阅一个讨论站点使用的脚本语言安全性的新闻组。　<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">&#160;</span></p>
<br>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/4e7f754e0f5c8a03b3de055e.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  14:58</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/4e7f754e0f5c8a03b3de055e.html</guid>
</item>

<item>
        <title><![CDATA[Web测试指南（四）－web兼容性测试]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/dc6103a4722752fd9052ee5e.html]]></link>
        <description><![CDATA[
		
		<span style="background: rgb(242, 248, 249) none repeat scroll 0% 0%; font-size: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; ">
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; "></span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">4 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">兼容性测试<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">4.1 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">平台测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">市场上有很多不同的操作系统类型，最常见的有<span>Windows</span>、<span>Unix</span>、<span>Macintosh</span>、<span>Linux</span>等。<span>Web</span>应用系统的最终用户究竟使用哪一种操作系统，取决于用户系统的配置。这样，就可能会发生兼容性问题，同一个应用可能在某些操作系统下能正常运行，但在另外的操作系统下可能会运行失败。<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">因此，在<span>Web</span>系统发布之前，需要在各种操作系统下对<span>Web</span>系统进行兼容性测试。<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">4.2 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">浏览器测试<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">浏览器是<span>Web</span>客户端最核心的构件，来自不同厂商的浏览器对<span>Java</span>，、<span>JavaScript</span>、<span> ActiveX</span>、<span> plug-ins</span>或不同的<span>HTML</span>规格有不同的支持。例如，<span>ActiveX</span>是<span>Microsoft</span>的产品，是为<span>Internet Explorer</span>而设计的，<span>JavaScript</span>是<span>Netscape</span>的产品，<span>Java</span>是<span>Sun</span>的产品等等。另外，框架和层次结构风格在不同的浏览器中也有不同的显示，甚至根本不显示。不同的浏览器对安全性和<span>Java</span>的设置也不一样。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">测试浏览器兼容性的一个方法是创建一个兼容性矩阵。在这个矩阵中，测试不同厂商、不同版本的浏览器对某些构件和设置的适应性。<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">4.3 </span><span style="font-size: 9pt; color: black; ">分辨率测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">页面版式在 </span><span style="font-size: 9pt; color: black; ">640x400</span><span style="font-size: 9pt; color: black; ">、</span><span style="font-size: 9pt; color: black; ">600x800</span><span style="font-size: 9pt; color: black; ">&#160;</span><span style="font-size: 9pt; color: black; ">或 </span><span style="font-size: 9pt; color: black; ">1024x768 </span><span style="font-size: 9pt; color: black; ">的分辨率模式下是否显示正常<span>? </span>字体是否太小以至于无法浏览<span>? </span>或者是太大<span>? </span>文本和图片是否对齐<span>?</span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">4.4 Modem/</span><span style="font-size: 9pt; color: black; ">连接速率<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">是否有这种情况，用户使用 </span><span style="font-size: 9pt; color: black; ">28.8 modem</span><span style="font-size: 9pt; color: black; ">下载一个页面需要 </span><span style="font-size: 9pt; color: black; ">10</span><span style="font-size: 9pt; color: black; ">&#160;</span><span style="font-size: 9pt; color: black; ">分钟，但测试人员在测试的时候使用的是 </span><span style="font-size: 9pt; color: black; ">T1</span><span style="font-size: 9pt; color: black; ">&#160;</span><span style="font-size: 9pt; color: black; ">专线<span>? </span>用户在下载文章或演示的时候，可能会等待比较长的时间，但却不会耐心等待首页的出现。最后，需要确认图片不会太大。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">4.5 </span><span style="font-size: 9pt; color: black; ">打印机<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">用 户可能会将网页打印下来。因此网也在设计的时候要考虑到打印问题，注意节约纸张和油墨。有不少用户喜欢阅读而不是盯着屏幕，因此需要验证网页打印是否正 常。有时在屏幕上显示的图片和文本的对齐方式可能与打印出来的东西不一样。测试人员至少需要验证订单确认页面打印是正常的。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">4.6 </span><span style="font-size: 9pt; color: black; ">组合测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">最后需要进行组合测试。</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">600x800</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">的分辨率在<span> MAC </span>机上可能不错，但是在 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">IBM </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">兼容机上却很难看。在 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">IBM</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">机器上使用 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">Netscape</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">能正常显示，但却无法使用 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">Lynx </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">来浏览。如果是内部使用的 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">web </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">站点，测试可能会轻松一些。如果公司指定使用某个类型的浏览器，那么只需在该浏览器上进行测试。如果所有的人都使用<span> T1 </span>专线，可能不需要测试下载施加。<span>(</span>但需要注意的是，可能会有员工从家里拨号进入系统<span>) </span>有些内部应用程序，开发部门可能在系统需求中声明不支持某些系统而只支持一些那些已设置的系统。但是，理想的情况是，系统能在所有机器上运行，这样就不会限制将来的发展和变动。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">采取措施：根据实际情况，采取等价划分的方法，列出兼容性矩阵<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">&#160;</span></p>
<br>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/dc6103a4722752fd9052ee5e.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  14:58</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/dc6103a4722752fd9052ee5e.html</guid>
</item>

<item>
        <title><![CDATA[Web测试指南（三）－用户界面测试]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/0173f2092cddc788d1581b5d.html]]></link>
        <description><![CDATA[
		
		<span style="background: rgb(242, 248, 249) none repeat scroll 0% 0%; font-size: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; ">
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; "></span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">3 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">用户界面测试<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">3.1 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">导航测试<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">导航描述了用户在一个页面内操作的方式，在不同的用户接口控制之间，例如按钮、对话框、列表和窗口等；或在不同的连接页面之间。通过考虑下列问题，可以决定一个<span>Web</span>应用系统是否易于导航：导航是否直观？<span>Web</span>系统的主要部分是否可通过主页存取？<span>Web</span>系统是否需要站点地图、搜索引擎或其他的导航帮助？<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">在一个页面上放太多的信息往往起到与预期相反的效果。<span>Web</span>应用系统的用户趋向于目的驱动，很快地扫描一个<span>Web</span>应用系统，看是否有满足自己需要的信息，如果没有，就会很快地离开。很少有用户愿意花时间去熟悉<span>Web</span>应用系统的结构，因此，<span>Web</span>应用系统导航帮助要尽可能地准确。 </span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">导航的另一个重要方面是<span>Web</span>应用系统的页面结构、导航、菜单、连接的风格是否一致。确保用户凭直觉就知道<span>Web</span>应用系统里面是否还有内容，内容在什么地方。<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">Web</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">应用系统的层次一旦决定，就要着手测试用户导航功能，让最终用户参与这种测试，效果将更加明显。 </span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">3.2 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">图形测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">在<span>Web</span>应用系统中，适当的图片和动画既能起到广告宣传的作用，又能起到美化页面的功能。一个<span>Web</span>应用系统的图形可以包括图片、动画、边框、颜色、字体、背景、按钮等。图形测试的内容有： </span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">（<span>1</span>）要确保图形有明确的用途，图片或动画不要胡乱地堆在一起，以免浪费传输时间。<span>Web</span>应用系统的图片尺寸要尽量地小，并且要能清楚地说明某件事情，一般都链接到某个具体的页面。</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">（<span>2</span>）验证所有页面字体的风格是否一致。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">（<span>3</span>）背景颜色应该与字体颜色和前景颜色相搭配。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">（<span>4</span>）图片的大小和质量也是一个很重要的因素，一般采用<span>JPG</span>或<span>GIF</span>压缩，最好能使图片的大小减小到 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">30k </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">以下</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">（<span>5</span>）最后，需要验证的是文字回绕是否正确。如果说明文字指向右边的图片，应该确保该图片出现在右边。不要因为使用图片而使窗口和段落排列古怪或者出现孤行。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">通常来说，使用少许或尽量不使用背景是个不错的选择。如果您想用背景，那么最好使用单色的，和导航条一起放在页面的左边。另外，图案和图片可能会转移用户的注意力。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">3.3</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">内容测试 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">内容测试用来检验<span>Web</span>应用系统提供信息的正确性、准确性和相关性。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">信息的正确性是指信息是可靠的还是误传的。例如，在商品价格列表中，错误的价格可能引起财政问题甚至导致法律纠纷；信息的准确性是指是否有语法或拼写错误。这种测试通常使用一些文字处理软件来进行，例如使用<span>Microsoft Word</span>的<span>&quot;</span>拼音与语法检查<span>&quot;</span>功能；信息的相关性是指是否在当前页面可以找到与当前浏览信息相关的信息列表或入口，也就是一般<span>Web</span>站点中的所谓<span>&quot;</span>相关文章列表<span>&quot;</span>。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">对 于开发人员来说，可能先有功能然后才对这个功能进行描述。大家坐在一起讨论一些新的功能，然后开始开发，在开发的时候，开发人员可能不注重文字表达，他们 添加文字可能只是为了对齐页面。不幸的是，这样出来的产品可能产生严重的误解。因此测试人员和公关部门一起检查内容的文字表达是否恰当。否则，公司可能陷 入麻烦之中，也可能引起法律方面的问题。测试人员应确保站点看起来更专业些。过分地使用粗体字、大字体和下划线可能会让用户感到不舒服。在进行用户可用性 方面的测试时，最好先请图形设计专家对站点进行评估。你可能不希望看到一篇到处是黑体字的文章，所以相信您也希望自己的站点能更专业一些。最后，需要确定 是否列出了相关站点的链接。很多站点希望用户将邮件发到一个特定的地址，或者从某个站点下载浏览器。但是如果用户无法点击这些地址，他们可能会觉得很迷 惑。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">3.4 </span><span style="font-size: 9pt; color: black; ">表格测试</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">&#160;</span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">需要验证表格是否设置正确。用户是否需要向右滚动页面才能看见产品的价格？把价格放在左边，而把产品细节放在右边是否更有效<span>? </span>每一栏的宽度是否足够宽，表格里的文字是否都有折行？是否有因为某一格的内容太多，而将整行的内容拉长<span>?</span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">3.5 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">整体界面测试<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">整体界面是指整个<span>Web</span>应用系统的页面结构设计，是给用户的一个整体感。例如：当用户浏览<span>Web</span>应用系统时是否感到舒适，是否凭直觉就知道要找的信息在什么地方？整个<span>Web</span>应用系统的设计风格是否一致？<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">对整体界面的测试过程，其实是一个对最终用户进行调查的过程。一般<span>Web</span>应用系统采取在主页上做一个调查问卷的形式，来得到最终用户的反馈信息。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">对所有的用户界面测试来说，都需要有外部人员（与<span>Web</span>应用系统开发没有联系或联系很少的人员）的参与，最好是最终用户的参与。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">采取措施：手动测试，参与人员最好有外部人员<span></span></span></p>
<br>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/0173f2092cddc788d1581b5d.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  14:57</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/0173f2092cddc788d1581b5d.html</guid>
</item>

<item>
        <title><![CDATA[Web测试指南（二）－Web性能测试]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/94230b380c33b22eb8998f5d.html]]></link>
        <description><![CDATA[
		
		<span style="background: rgb(242, 248, 249) none repeat scroll 0% 0%; font-size: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; ">
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; "></span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">2&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">性能测试 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">2.1&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">连接速度测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">用户连接到<span>Web</span>应用系统的速度根据上网方式的变化而变化，他们或许是电话拨号，或是宽带上网。当下载一个程序时，用户可以等较长的时间，但如果仅仅访问一个页面就不会这样。如果<span>Web</span>系统响应时间太长（例如超过<span>5</span>秒钟），用户就会因没有耐心等待而离开。 </span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">另外，有些页面有超时的限制，如果响应速度太慢，用户可能还没来得及浏览内容，就需要重新登陆了。而且，连接速度太慢，还可能引起数据丢失，使用户得不到真实的页面。 </span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">2.2&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">负载测试 </span><span style="font-size: 9pt; color: black; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">负载测试是为了测量<span>Web</span>系统在某一负载级别上的性能，以保证<span>Web</span>系统在需求范围内能正常工作。负载级别可以是某个时刻同时访问<span>Web</span>系统的用户数量，也可以是在线数据处理的数量。例如：<span>Web</span>应用系统能允许多少个用户同时在线？如果超过了这个数量，会出现什么现象？<span>Web</span>应用系统能否处理大量用户对同一个页面的请求？<span> </span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">2.3&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">压力测试</span><span style="font-size: 9pt; color: black; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">负载测试应该安排在<span>Web</span>系统发布以后，在实际的网络环境中进行测试。因为一个企业内部员工，特别是项目组人员总是有限的，而一个<span>Web</span>系统能同时处理的请求数量将远远超出这个限度，所以，只有放在<span>Internet</span>上，接受负载测试，其结果才是正确可信的。 </span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">进行压力测试是指实际破坏一个<span>Web</span>应用系统，测试系统的反映。压力测试是测试系统的限制和故障恢复能力，也就是测试<span>Web</span>应用系统会不会崩溃，在什么情况下会崩溃。黑客常常提供错误的数据负载，直到<span>Web</span>应用系统崩溃，接着当系统重新启动时获得存取权。</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">压力测试的区域包括表单、登陆和其他信息传输页面等。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">负载<span>/</span>压力测试应该关注什么<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">测试需要验证系统能否在同一时间响应大量的用户，在用户传送大量数据的时候能否响应，系统能否长时间运行。可访问性对用户来说是极其重要的。如果用户得到</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">“</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">系统忙</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">”</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">的信息，他们可能放弃，并转向竞争对手。系统检测不仅要使用户能够正常访问站点，在很多情况下，可能会有黑客试图通过发送大量数据包来攻击服务器。出于安全的原因，测试人员应该知道当系统过载时，需要采取哪些措施，而不是简单地提升系统性能。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: green; ">瞬间访问高峰</span><span style="font-size: 9pt; color: green; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">如果您的站点用于公布彩票的抽奖结果，最好使系统在中奖号码公布后的一段时间内能够响应上百万的请求。负载测试工具能够模拟<span> X </span>个用户同时访问测试站点。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: green; ">每个用户传送大量数据<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">网上书店的多数用户可能只订购<span> 1-5 </span>书，但是大学书店可能会订购<span> 5000 </span>本有关心理学介绍的课本<span>? </span>或者一个祖母为她的<span> 50 </span>个儿孙购买圣诞礼物<span>(</span>当然每个孩子都有自己的邮件地址<span>) </span>系统能处理单个用户的大量数据吗<span>?</span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: green; ">长时间的使用<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">如果站点用于处理鲜花订单，那么至少希望它在母亲节前的一周内能持续运行。如果站点提供基于<span> web </span>的<span> email </span>服务，那么点最好能持续运行几个月，甚至几年。可能需要使用自动测试工具来完成这种类型的测试，因为很难通过手工完成这些测试。你可以想象组织<span>100 </span>个人同时点击某个站点。但是同时组织<span> 100000 </span>个人呢。通常，测试工具在第二次使用的时候，它创造的效益，就足以支付成本。而且，测试工具安装完成之后，再次使用的时候，只要点击几下。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">采取措施：采用测试工具<span>WAS</span>、<span>ACT</span>协助进行测试<span></span></span></p>
<br>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/94230b380c33b22eb8998f5d.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  14:56</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/94230b380c33b22eb8998f5d.html</guid>
</item>

<item>
        <title><![CDATA[Web测试指南（一）－Web功能测试]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/eff2ae1075eb620b213f2e5c.html]]></link>
        <description><![CDATA[
		
		<span style="background: rgb(242, 248, 249) none repeat scroll 0% 0%; font-size: 12pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; ">
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); "><font size="3">在<span>Web</span>工程过程中，基于<span>Web</span>系统的测试、确认和验收是一项重要而富有挑战性的工作。基于<span>Web</span>的系统测试与传统的软件测试不同，它不但需要检查和验证是否按照设计的要求运行，而且还要测试系统在不同用户的浏览器端的显示是否合适。重要的是，还要从最终用户的角度进行安全性和可用性测试。然而，<span>Internet</span>和<span>Web</span>媒体的不可预见性使测试基于<span>Web</span>的系统变得困难。因此，我们必须为测试和评估复杂的基于<span>Web</span>的系统研究新的方法和技术。<span></span></font></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; "><font size="3">本文将<span> web </span>测试分为<span> 6 </span>个部分：</font></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; "><font size="3"><span></span></font></span>&#160;</p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><strong><font size="3"><span style="font-size: 9pt; color: black; ">1.&#160;&#160; </span><span style="font-size: 9pt; color: black; ">功能测试</span></font></strong></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><strong><font size="3"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">2.&#160;&#160; <span style="font-size: 9pt; color: black; ">性能测试</span><span><font color="#000000"> </font></span></span><span style="font-size: 9pt; color: black; ">（包括负载<span>/</span>压力测试）</span></font></strong></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><strong><font size="3"><span style="font-size: 9pt; color: black; ">3.&#160;&#160; </span><span style="font-size: 9pt; color: black; ">用户界面测试</span></font></strong></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><strong><font size="3"><span style="font-size: 9pt; color: black; ">4.&#160;&#160; </span><span style="font-size: 9pt; color: black; ">兼容性测试<span></span></span></font></strong></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><strong><font size="3"><span style="font-size: 9pt; color: black; ">5.&#160;&#160; </span><span style="font-size: 9pt; color: black; ">安全测试<span></span></span></font></strong></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; "><strong><font size="3">6.&#160;&#160; </font></strong></span><span style="font-size: 9pt; color: black; "><strong><font size="3">接口测试</font></strong><span> </span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; "><span></span></span>&#160;</p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">本文的目的是覆盖<span> web </span>测试的各个方面，未就某一主题进行深入说明。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">1 </span><span style="font-size: 9pt; color: black; ">功能测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">1.1 </span><span style="font-size: 9pt; color: black; ">链接测试</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">链接是<span>Web</span>应用系统的一个主要特征，它是在页面之间切换和指导用户去一些不知道地址的页面的主要手段。链接测试可分为三个方面。首先，测试所有链接是否按指示的那样确实链接到了该链接的页面；其次，测试所链接的页面是否存在；最后，保证<span>Web</span>应用系统上没有孤立的页面，所谓孤立页面是指没有链接指向该页面，只有知道正确的<span>URL</span>地址才能访问。 <span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">链接测试可以自动进行，现在已经有许多工具可以采用。链接测试必须在集成测试阶段完成，也就是说，在整个<span>Web</span>应用系统的所有页面开发完成之后进行链接测试。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">采取措施：采用自动检测网站链接的软件来进行。</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">推荐软件：</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">Xenu Link Sleuth </span><span style="font-size: 9pt; color: red; ">免费<span>&#160;</span>绿色免安装软件</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">HTML Link Validator </span><span style="font-size: 9pt; color: red; ">共享（<span>30</span>天试用）<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">1.2 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">表单测试 </span><span style="font-size: 9pt; color: red; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">当用户通过表单提交信息的时候，都希望表单能正常工作。</span><span style="font-size: 9pt; color: black; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">如 果使用表单来进行在线注册，要确保提交按钮能正常工作，当注册完成后应返回注册成功的消息。如果使用表单收集配送信息，应确保程序能够正确处理这些数据， 最后能让顾客能让客户收到包裹。要测试这些程序，需要验证服务器能正确保存这些数据，而且后台运行的程序能正确解释和使用这些信息。</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">当 用户使用表单进行用户注册、登陆、信息提交等操作时，我们必须测试提交操作的完整性，以校验提交给服务器的信息的正确性。例如：用户填写的出生日期与职业 是否恰当，填写的所属省份与所在城市是否匹配等。如果使用了默认值，还要检验默认值的正确性。如果表单只能接受指定的某些值，则也要进行测试。例如：只能 接受某些字符，测试时可以跳过这些字符，看系统是否会报错。</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">1.3 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">数据校验</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">如果系根据业务规则需要对用户输入进行校验，需要保证这些校验功能正常工作。例如，省份的字段可以用一个有效列表进行校验。在这种情况下，需要验证列表完整而且程序正确调用了该列表</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">(</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">例如在列表中添加一个测试值，确定系统能够接受这个测试值</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">)</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">。</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">在测试表单时，该项测试和表单测试可能会有一些重复。</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">1.2</span><span style="font-size: 9pt; color: red; ">和</span><span style="font-size: 9pt; color: red; ">1.3</span><span style="font-size: 9pt; color: red; ">的采取措施：第一个完整的版本采用手动检查，同时形成</span><span style="font-size: 9pt; color: red; ">WinRunner</span><span style="font-size: 9pt; color: red; ">（</span><span style="font-size: 9pt; color: red; ">QTP</span><span style="font-size: 9pt; color: red; ">）脚本；回归测试以及升级版本主要靠</span><span style="font-size: 9pt; color: red; ">WinRunner</span><span style="font-size: 9pt; color: red; ">（</span><span style="font-size: 9pt; color: red; ">QTP</span><span style="font-size: 9pt; color: red; ">）自动回放测试。</span><span style="font-size: 9pt; color: red; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">1.4 cookies</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">测试</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">Cookies</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">通常用来存储用户信息和用户在某应用系统的操作，当一个用户使用<span>Cookies</span>访问了某一个应用系统时，<span>Web</span>服务器将发送关于用户的信息，把该信息以<span>Cookies</span>的形式存储在客户端计算机上，这可用来创建动态和自定义页面或者存储登陆等信息。 <span><br>
</span>　　如果<span>Web</span>应用系统使用了<span>Cookies</span>，就必须检查<span>Cookies</span>是否能正常工作。测试的内容可包括<span>Cookies</span>是否起作用，是否按预定的时间进行保存，刷新对<span>Cookies</span>有什么影响等。如果在 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">cookies</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">中保存了注册信息，请确认该 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">cookie</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">能够正常工作而且已对这些信息已经加密。如果使用 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">cookie</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">&#160;</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">来统计次数，需要验证次数累计正确。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">采取措施：</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; "><span>&#160;&#160;&#160;&#160; </span>1 </span><span style="font-size: 9pt; color: red; ">采用黑盒测试：采用上面提到的方法进行测试</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 22.5pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">2 </span><span style="font-size: 9pt; color: red; ">采用查看<span>cookies</span>的软件进行（初步的想法）</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">可以选择采用的软件</span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">IECookiesView v1.50 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">Cookies Manager v1.1</span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">1.5 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">数据库测试<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">在<span>Web</span>应用技术中，数据库起着重要的作用，数据库为<span>Web</span>应用系统的管理、运行、查询和实现用户对数据存储的请求等提供空间。在<span>Web</span>应用中，最常用的数据库类型是关系型数据库，可以使用<span>SQL</span>对信息进行处理。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">在使用了数据库的<span>Web</span>应用系统中，一般情况下，可能发生两种错误，分别是数据一致性错误和输出错误。数据一致性错误主要是由于用户提交的表单信息不正确而造成的，而输出错误主要是由于网络速度或程序设计问题等引起的，针对这两种情况，可分别进行测试。</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">采取措施：暂时没有更好的测试方法</span><span style="font-size: 9pt; "></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; "><span>&#160;&#160;&#160;&#160; </span></span><span style="font-size: 9pt; color: red; ">考虑结合到<span>1.2</span>和<span>1.3</span>的测试中<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">1.6 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">应用程序特定的功能需求<span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">最重要的是，测试人员需要对应用程序特定的功能需求进行验证。尝试用户可能进行的所有操作：下订单、更改订单、取消订单、核对订单状态、在货物发送之前更改送货信息、在线支付等等。这是用户之所以使用网站的原因，一定要确认网站能像广告宣传的那样神奇。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: black; ">采取措施：深刻理解需求说明文档<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">1.7 </span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">设计语言测试 <span></span></span></p>
<p style="margin: 0cm 0cm 0pt; text-indent: 18pt;" class="MsoNormal"><span style="font-size: 9pt; color: rgb(51, 51, 51); ">Web</span><span style="font-size: 9pt; color: rgb(51, 51, 51); ">设计语言版本的差异可以引起客户端或服务器端严重的问题，例如使用哪种版本的<span>HTML</span>等。当在分布式环境中开发时，开发人员都不在一起，这个问题就显得尤为重要。除了<span>HTML</span>的版本问题外，不同的脚本语言，例如<span>Java</span>、<span>JavaScript</span>、<span> ActiveX</span>、<span>VBScript</span>或<span>Perl</span>等也要进行验证。<span></span></span></p>
<p style="margin: 0cm 0cm 0pt;" class="MsoNormal"><span style="font-size: 9pt; color: red; ">暂时没有方法测试，可以多参考一点讨论组内的更新信息<span></span></span></p>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/web%B2%E2%CA%D4">web测试</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/eff2ae1075eb620b213f2e5c.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  14:55</pubDate>
        <category><![CDATA[web测试]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/eff2ae1075eb620b213f2e5c.html</guid>
</item>

<item>
        <title><![CDATA[HTML 5 参考手册]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/c89eeaea47ab6cd9d539c9ff.html]]></link>
        <description><![CDATA[
		
		<p>W3C 在2008年1月22日发布了最新的 HTML 5 工作草案。HTML 5 工作组包括 AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera 以及数百个其他的开发商。HTML 5 中的一些新特性：嵌入音频、视频、图片的<abbr title="Application Programming Interface">函数</abbr>、客户端数据存储，以及交互式文档。其他特性包括新的页面元素，比如 &lt;header&gt;, &lt;section&gt;, &lt;footer&gt;, 以及 &lt;figure&gt;。</p>
<p>通过制定如何处理所有 HTML 元素以及如何从错误中恢复的精确规则，HTML 5 改进了互操作性，并减少了开发成本。</p>
<h3>按字母顺序排列</h3>
<ul>
    <li><em>4</em>: 指示在 HTML 4.01 中是否定义了该元素</li>
    <li><em>5</em>: 指示在 HTML 5 中是否定义了该元素</li>
</ul>
<table class="dataintable FCK__ShowTableBorders">
    <tbody>
        <tr>
            <th>标签</th>
            <th>描述</th>
            <th>4</th>
            <th>5</th>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_comment.asp">&lt;!--...--&gt;</a></td>
            <td>定义注释。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_doctype.asp">&lt;!DOCTYPE&gt;</a></td>
            <td>定义文档类型。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_a.asp">&lt;a&gt;</a></td>
            <td>定义超链接。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_abbr.asp">&lt;abbr&gt;</a></td>
            <td>定义缩写。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_acronym.asp">&lt;acronym&gt;</a></td>
            <td>不支持。定义首字母缩写。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_address.asp">&lt;address&gt;</a></td>
            <td>定义地址元素。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_applet.asp">&lt;applet&gt;</a></td>
            <td>不支持。定义 applet。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_area.asp">&lt;area&gt;</a></td>
            <td>定义图像映射中的区域。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_article.asp">&lt;article&gt;</a></td>
            <td>定义 article。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_aside.asp">&lt;aside&gt;</a></td>
            <td>定义页面内容之外的内容。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_audio.asp">&lt;audio&gt;</a></td>
            <td>定义声音内容。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_b.asp">&lt;b&gt;</a></td>
            <td>定义粗体文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_base.asp">&lt;base&gt;</a></td>
            <td>定义页面中所有链接的基准 URL。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_basefont.asp">&lt;basefont&gt;</a></td>
            <td>不支持。请使用 CSS 代替。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_bdo.asp">&lt;bdo&gt;</a></td>
            <td>定义文本显示的方向。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_big.asp">&lt;big&gt;</a></td>
            <td>不支持。定义大号文本。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_blockquote.asp">&lt;blockquote&gt;</a></td>
            <td>定义长的引用。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_body.asp">&lt;body&gt;</a></td>
            <td>定义 body 元素。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_br.asp">&lt;br&gt;</a></td>
            <td>插入换行符。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_button.asp">&lt;button&gt;</a></td>
            <td>定义按钮。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_canvas.asp">&lt;canvas&gt;</a></td>
            <td>定义图形。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_caption.asp">&lt;caption&gt;</a></td>
            <td>定义表格标题。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_center.asp">&lt;center&gt;</a></td>
            <td>不支持。定义居中的文本。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;cite&gt;</a></td>
            <td>定义引用。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;code&gt;</a></td>
            <td>定义计算机代码文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_col.asp">&lt;col&gt;</a></td>
            <td>定义表格列的属性。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_colgroup.asp">&lt;colgroup&gt;</a></td>
            <td>定义表格列的分组。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_command.asp">&lt;command&gt;</a></td>
            <td>定义命令按钮。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_datagrid.asp">&lt;datagrid&gt;</a></td>
            <td>定义树列表 (tree-list) 中的数据。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_datalist.asp">&lt;datalist&gt;</a></td>
            <td>定义下拉列表。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_datatemplate.asp">&lt;datatemplate&gt;</a></td>
            <td>定义数据模板。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_dd.asp">&lt;dd&gt;</a></td>
            <td>定义定义的描述。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_del.asp">&lt;del&gt;</a></td>
            <td>定义删除文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_details.asp">&lt;details&gt;</a></td>
            <td>定义元素的细节。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_dialog.asp">&lt;dialog&gt;</a></td>
            <td>定义对话（会话）。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_dir.asp">&lt;dir&gt;</a></td>
            <td>不支持。定义目录列表。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_div.asp">&lt;div&gt;</a></td>
            <td>定义文档中的一个部分。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;dfn&gt;</a></td>
            <td>定义定义项目。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_dl.asp">&lt;dl&gt;</a></td>
            <td>定义定义列表。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_dt.asp">&lt;dt&gt;</a></td>
            <td>定义定义的项目。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;em&gt;</a></td>
            <td>定义强调文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_embed.asp">&lt;embed&gt;</a></td>
            <td>定义外部交互内容或插件。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_eventsource.asp">&lt;event-source&gt;</a></td>
            <td>为服务器发送的事件定义目标。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_fieldset.asp">&lt;fieldset&gt;</a></td>
            <td>定义 fieldset。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_figure.asp">&lt;figure&gt;</a></td>
            <td>定义媒介内容的分组，以及它们的标题。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_font.asp">&lt;font&gt;</a></td>
            <td>不赞成。定义文本的字体、尺寸和颜色。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_footer.asp">&lt;footer&gt;</a></td>
            <td>定义 section 或 page 的页脚。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_form.asp">&lt;form&gt;</a></td>
            <td>定义表单。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_frame.asp">&lt;frame&gt;</a></td>
            <td>不支持。定义子窗口（框架）。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_frameset.asp">&lt;frameset&gt;</a></td>
            <td>不支持。定义框架的集。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_hn.asp">&lt;h1&gt; to &lt;h6&gt;</a></td>
            <td>定义标题 1 到标题 6。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_head.asp">&lt;head&gt;</a></td>
            <td>定义关于文档的信息。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_header.asp">&lt;header&gt;</a></td>
            <td>定义 section 或 page 的页眉。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_hr.asp">&lt;hr&gt;</a></td>
            <td>定义水平线。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_html.asp">&lt;html&gt;</a></td>
            <td>定义 html 文档。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_i.asp">&lt;i&gt;</a></td>
            <td>定义斜体文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_iframe.asp">&lt;iframe&gt;</a></td>
            <td>定义行内的子窗口（框架）。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_img.asp">&lt;img&gt;</a></td>
            <td>定义图像。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_input.asp">&lt;input&gt;</a></td>
            <td>定义输入域。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_ins.asp">&lt;ins&gt;</a></td>
            <td>定义插入文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td>&lt;isindex&gt;</td>
            <td>不支持。定义单行的输入域。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;kbd&gt;</a></td>
            <td>定义键盘文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_label.asp">&lt;label&gt;</a></td>
            <td>定义表单控件的标注。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_legend.asp">&lt;legend&gt;</a></td>
            <td>定义 fieldset 中的标题。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_li.asp">&lt;li&gt;</a></td>
            <td>定义列表的项目。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_link.asp">&lt;link&gt;</a></td>
            <td>定义资源引用。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_m.asp">&lt;m&gt;</a></td>
            <td>定义有记号的文本。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_map.asp">&lt;map&gt;</a></td>
            <td>定义图像映射。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_menu.asp">&lt;menu&gt;</a></td>
            <td>定义菜单列表。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_meta.asp">&lt;meta&gt;</a></td>
            <td>定义元信息。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_meter.asp">&lt;meter&gt;</a></td>
            <td>定义预定义范围内的度量。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_nav.asp">&lt;nav&gt;</a></td>
            <td>定义导航链接。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_nest.asp">&lt;nest&gt;</a></td>
            <td>定义数据模板中的嵌套点。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_noframes.asp">&lt;noframes&gt;</a></td>
            <td>不支持。定义 noframe 部分。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_noscript.asp">&lt;noscript&gt;</a></td>
            <td>不支持。定义 noscript 部分。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_object.asp">&lt;object&gt;</a></td>
            <td>定义嵌入对象。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_ol.asp">&lt;ol&gt;</a></td>
            <td>定义有序列表。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_optgroup.asp">&lt;optgroup&gt;</a></td>
            <td>定义选项组。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_option.asp">&lt;option&gt;</a></td>
            <td>定义下拉列表中的选项。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_output.asp">&lt;output&gt;</a></td>
            <td>定义输出的一些类型。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_p.asp">&lt;p&gt;</a></td>
            <td>定义段落。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_param.asp">&lt;param&gt;</a></td>
            <td>为对象定义参数。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_pre.asp">&lt;pre&gt;</a></td>
            <td>定义预格式化文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_progress.asp">&lt;progress&gt;</a></td>
            <td>定义任何类型的任务的进度。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_q.asp">&lt;q&gt;</a></td>
            <td>定义短的引用。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_rule.asp">&lt;rule&gt;</a></td>
            <td>为升级模板定义规则。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_strike.asp">&lt;s&gt;</a></td>
            <td>不支持。定义加删除线的文本。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;samp&gt;</a></td>
            <td>定义样本计算机代码。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_script.asp">&lt;script&gt;</a></td>
            <td>定义脚本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_section.asp">&lt;section&gt;</a></td>
            <td>定义 section。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_select.asp">&lt;select&gt;</a></td>
            <td>定义可选列表。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_small.asp">&lt;small&gt;</a></td>
            <td>不支持。定义小号文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_source.asp">&lt;source&gt;</a></td>
            <td>定义媒介源。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_span.asp">&lt;span&gt;</a></td>
            <td>定义文档中的 section。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_strike.asp">&lt;strike&gt;</a></td>
            <td>不支持。定义加删除线的文本。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;strong&gt;</a></td>
            <td>定义强调文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_style.asp">&lt;style&gt;</a></td>
            <td>定义样式定义。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_sup_sub.asp">&lt;sub&gt;</a></td>
            <td>定义上标文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_sup_sub.asp">&lt;sup&gt;</a></td>
            <td>定义下标文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_table.asp">&lt;table&gt;</a></td>
            <td>定义表格。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_tbody.asp">&lt;tbody&gt;</a></td>
            <td>定义表格的主体。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_td.asp">&lt;td&gt;</a></td>
            <td>定义表格单元。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_textarea.asp">&lt;textarea&gt;</a></td>
            <td>定义 textarea。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_tfoot.asp">&lt;tfoot&gt;</a></td>
            <td>定义表格的脚注。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_th.asp">&lt;th&gt;</a></td>
            <td>定义表头。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_thead.asp">&lt;thead&gt;</a></td>
            <td>定义表头。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_time.asp">&lt;time&gt;</a></td>
            <td>定义日期/时间。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_title.asp">&lt;title&gt;</a></td>
            <td>定义文档的标题。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_tr.asp">&lt;tr&gt;</a></td>
            <td>定义表格行。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_tt.asp">&lt;tt&gt;</a></td>
            <td>不支持。定义打字机文本。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_u.asp">&lt;u&gt;</a></td>
            <td>不支持。定义下划线文本。</td>
            <td>4</td>
            <td> </td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_ul.asp">&lt;ul&gt;</a></td>
            <td>定义无序列表。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_phrase_elements.asp">&lt;var&gt;</a></td>
            <td>定义变量。</td>
            <td>4</td>
            <td>5</td>
        </tr>
        <tr>
            <td><a href="http://www.w3school.com.cn/html5/html5_video.asp">&lt;video&gt;</a></td>
            <td>定义视频。</td>
            <td> </td>
            <td>5</td>
        </tr>
        <tr>
            <td>&lt;xmp&gt;</td>
            <td>不支持。定义预格式文本。</td>
            <td>4</td>
            <td>5</td>
        </tr>
    </tbody>
</table> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/Html">Html</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/c89eeaea47ab6cd9d539c9ff.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  10:47</pubDate>
        <category><![CDATA[Html]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/c89eeaea47ab6cd9d539c9ff.html</guid>
</item>

<item>
        <title><![CDATA[Web缓存加速指南－面向站长和网站管理员]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/47010b347aff59315bb5f5fe.html]]></link>
        <description><![CDATA[
		
		<div class="entry-body">
<p>原文（英文）地址： <a href="http://www.mnot.net/cache_docs/">http://www.mnot.net/cache_docs/</a> 版权声明：<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh">署名-非商业性使用-禁止演绎 2.0</a><a target="_blank" href="http://www.chedong.com/tech/cache_docs.html%20"><br>
</a></p>
<p> </p>
<p><a target="_blank" href="http://www.chedong.com/tech/cache_docs.html%20"><br>
</a></p>
<p>这是一篇知识性的文档，主要目的是为了让Web缓存相关概念更容易被开发者理解并应用于实际的应用环境中。为了简要起见，某些实现方面的细节被简化或省略了。如果你更关心细节实现则完全不必耐心看完本文，后面参考文档和更多深入阅读部分可能是你更需要的内容。</p>
<ol>
    <li>什么是Web缓存，为什么要使用它？</li>
    <li>缓存的类型：</li>
    <ol>
        <li>浏览器缓存；</li>
        <li>代理服务器缓存；</li>
    </ol>
    <li>Web缓存无害吗？为什么要鼓励缓存？</li>
    <li>Web缓存如何工作：</li>
    <li>如何控制（控制不）缓存：</li>
    <ol>
        <li>HTML Meta标签 vs. HTTP头信息；</li>
        <li>Pragma HTTP头信息（为什么不起作用）；</li>
        <li>使用Expires（过期时间）HTTP头信息控制保鲜期；</li>
        <li>Cache-Control（缓存控制） HTTP头信息；</li>
        <li>校验参数和校验；</li>
    </ol>
    <li>创建利于缓存网站的窍门；</li>
    <li>编写利于缓存的脚本；</li>
    <li>常见问题解答；</li>
    <li>缓存机制的实现：Web服务器端配置；</li>
    <li>缓存机制的实现：服务器端脚本；</li>
    <li>参考文档和深入阅读；</li>
    <li>关于本文档；</li>
</ol>
</div>
<div class="entry-more">
<h3>什么是Web缓存，为什么要使用它？</h3>
Web缓存位于Web服务器之间（1个或多个，内容源服务器）和客户端之间（1个或多个）：缓存会根据进来的请求保存输出内容的副本，例如html页面，图片，文件（统称为副本），然后，当下一个请求来到的时候：如果是相同的URL，缓存直接使用副本响应访问请求，而不是向源服务器再次发送请求。<br>
<br>
使用缓存主要有2大理由：<br>
<ul>
    <li><strong>减少相应延迟</strong>：因为请求从缓存服务器（离客户端更近）而不是源服务器被相应，这个过程耗时更少，让web服务器看上去相应更快；</li>
    <li><strong>减少网络带宽消耗</strong>：当副本被重用时会减低客户端的带宽消耗；客户可以节省带宽费用，控制带宽的需求的增长并更易于管理。</li>
</ul>
<h3><span style="font-weight: bold">缓存的类型</span></h3>
<h4>浏览器缓存</h4>
<p>对于新一代的Web浏览器来说（例如：IE，Firefox）：一般都能在设置对话框中发现关于缓存的设置，通过在你的电脑上僻处一块硬盘空间用于存储你已经看过的网站的副本。浏览器缓存根据非常简单的规则进行工作：在同一个会话过程中（在当前浏览器没有被关闭之前）会检查一次并确定缓存的副本足够新。这个缓存对于用户点击&ldquo;后退&rdquo;或者点击刚访问过的链接特别有用，如果你浏览过程中访问到同一个图片，这些图片可以从浏览器缓存中调出而即时显现。</p>
<h4>代理服务器缓存</h4>
<p>Web代理服务器使用同样的缓存原理，只是规模更大。代理服务器群为成百上千用户服务使用同样的机制；大公司和ISP经常在他们的防火墙上架设代理缓存或者单独的缓存设备；</p>
<p>由于带路服务器缓存并非客户端或者源服务器的一部分，而是位于原网络之外，请求必须路由到他们才能起作用。一个方法是手工设置你的浏览器：告诉浏览器使用那个代理，另外一个是通过中间服务器：这个中间服务器处理所有的web请求，并将请求转发到后台网络，而用户不必配置代理，甚至不必知道代理的存在；</p>
<p>代理服务器缓存：是一个共享缓存，不只为一个用户服务，经常为大量用户使用，因此在减少相应时间和带宽使用方面很有效：因为同一个副本会被重用多次。</p>
<h4>网关缓存</h4>
<p>也被称为反向代理缓存或间接代理缓存，网关缓存也是一个中间服务器，和内网管理员部署缓存用于节省带宽不同：网关缓存一般是网站管理员自己部署：让他们的网站更容易扩展并获得更好的性能；<br>
请求有几种方法被路由到网关缓存服务器上：其中典型的是让用一台或多台负载均衡服务器从客户端看上去是源服务器；<br>
<br>
网络内容发布商 (Content delivery networks CDNs)分布网关缓存到整个（或部分）互联网上，并出售缓存服务给需要的网站，<a href="http://www.speedera.com/">Speedera</a>和<a href="http://www.akamai.com/">Akamai</a>就是典型的网络内容发布商(下文简称CDN)。<br>
<br>
本问主要关注于浏览器和代理缓存，当然，有些信息对于网关缓存也同样有效；</p>
<h3>Web缓存无害吗？为什么要鼓励缓存？</h3>
<p>Web缓存在互联网上最容易被误解的技术之一：网站管理员经常怕对网站失去控制，由于代理缓存会&ldquo;隐藏&rdquo;他们的用户，让他们感觉难以监控谁在使用他们的网站。<br>
不幸的是：就算不考虑Web缓存，互联网上也有很多网站使用非常多的参数以便管理员精确地跟踪用户如何使用他们的网站；如果这类问题也是你关心的，本文将告诉你如何获得精确的统计而不必将网站设计的非常缓存不友好。<br>
另外一个抱怨是缓存会给用户过期或失效的数据；无论如何：本文可以告诉你怎样配置你的服务器来控制你的内容将被如何缓存。<br>
<br>
CDN是另外一个有趣的方向，和其他代理缓存不同：CDN的网关缓存为希望被缓存的网站服务，没有以上顾虑。即使你使用了CDN，你也要考虑后续的代理服务器缓存和浏览器缓存问题。</p>
<p>另外一方面：如果良好地规划了你的网站，缓存会有助于网站服务更快，并节省服务器负载和互联网的链接请求。这个改善是显著的：一个难以缓存的网站可能需要几秒去载入页面，而对比有缓存的网站页面几乎是即时显现：用户更喜欢速度快的网站并更经常的访问；</p>
<p>这样想：很多大型互联网公司为全世界服务器群投入上百万资金，为的就是让用户访问尽可能快，客户端缓存也是这个目的，只不过更靠近用户一端，而且最好的一点是你甚至根本不用为此付费。</p>
<p>事实上，无论你是否喜欢，代理服务器和浏览器都回启用缓存。如果你没有配置网站正确的缓存，他们会按照缺省或者缓存管理员的策略进行缓存。</p>
<h3>缓存如何工作</h3>
<p>所有的缓存都用一套规则来帮助他们决定什么时候使用缓存中的副本提供服务（假设有副本可用的情况下）；一些规则在协议中有定义（HTTP协议1.0和1.1），一些规则由缓存的管理员设置（浏览器的用户或者代理服务器的管理员）；<br>
一般说来：遵循以下基本的规则（不必担心，你不必知道所有的细节，细节将随后说明）</p>
<ol>
    <li>如果响应头信息：告诉缓存器不要保留缓存，缓存器就不会缓存相应内容；</li>
    <li>如果请求信息是需要认证或者安全加密的，相应内容也不会被缓存；</li>
    <li>如果在回应中不存在校验器（ETag或者Last-Modified头信息），缓存服务器会认为缺乏直接的更新度信息，内容将会被认为不可缓存。</li>
    <li>一个缓存的副本如果含有以下信息：内容将会被认为是足够新的</li>
    <ul>
        <li>含有完整的过期时间和寿命控制头信息，并且内容仍在保鲜期内；</li>
        <li>浏览器已经使用过缓存副本，并且在一个会话中已经检查过内容的新鲜度；</li>
        <li>缓存代理服务器近期内已经使用过缓存副本，并且内容的最后更新时间在上次使用期之前；</li>
        <li>够新的副本将直接从缓存中送出，而不会向源服务器发送请求；</li>
    </ul>
    <li>如果缓存的副本已经太旧了，缓存服务器将向源服务器发出请求校验请求，用于确定是否可以继续使用当前拷贝继续服务；</li>
</ol>
总之：<strong><em>新鲜度</em></strong>和<strong>校验</strong>是确定内容是否可用的最重要途径：
<p> </p>
<p>如果副本足够新，从缓存中提取就立刻能用了；<br>
而经缓存器校验后发现副本的原件没有变化，系统也会避免将副本内容从源服务器整个重新传输一遍。</p>
<h3>如何控制（控制不）缓存</h3>
<p>有很多工具可以帮助设计师和网站管理员调整缓存服务器对待网站的方式，这也许需要你亲自下手对服务器的配置进行一些调整，但绝对值得；了解如何使用这些工具请参考后面的实现章节；</p>
<h4>HTML meta标签和HTTP 头信息</h4>
<p>HTML的编写者会在文档的&lt;HEAD&gt;区域中加入描述文档的各种属性，这些META标签常常被用于标记文档不可以被缓存或者标记多长时间后过期；<br>
META标签使用很简单：但是效率并不高，因为只有几种浏览器会遵循这个标记（那些真正会&ldquo;读懂&rdquo;HTML的浏览器），没有一种缓存代理服务器能遵循这个规则（因为它们几乎完全不解析文档中HTML内容）；有事会在Web页面中增加：Pragma: no-cache这个META标记，如果要让页面保持刷新，这个标签其实完全没有必要。<br>
如果你的网站托管在ISP机房中，并且机房可能不给你权限去控制HTTP的头信息（如：Expires和Cache-Control），大声控诉：这些机制对于你的工作来说是必须的；<br>
另外一方面： HTTP头信息可以让你对浏览器和代理服务器如何处理你的副本进行更多的控制。他们在HTML代码中是看不见的，一般由Web服务器自动生成。但是，根据你使用的服务，你可以在某种程度上进行控制。在下文中：你将看到一些有趣的HTTP头信息，和如何在你的站点上应用部署这些特性。<br>
<br>
HTTP头信息发送在HTML代码之前，只有被浏览器和一些中间缓存能看到，一个典型的HTTP 1.1协议返回的头信息看上去像这样：</p>
<div style="margin-left: 40px"><span style="font-style: italic">HTTP/1.1 200 OK</span><br>
<span style="font-style: italic">Date: Fri, 30 Oct 1998 13:19:41 GMT</span><br>
<span style="font-style: italic">Server: Apache/1.3.3 (Unix)</span><br>
<span style="font-style: italic">Cache-Control: max-age=3600, must-revalidate</span><br>
<span style="font-style: italic">Expires: Fri, 30 Oct 1998 14:19:41 GMT</span><br>
<span style="font-style: italic">Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT</span><br>
<span style="font-style: italic">ETag: &quot;3e86-410-3596fbbc&quot;</span><br>
<span style="font-style: italic">Content-Length: 1040</span><br>
<span style="font-style: italic">Content-Type: text/html</span></div>
<p><br>
在头信息空一行后是HTML代码的输出，关于如何设置HTTP头信息请参考实现章节；</p>
<h4>Pragma HTTP头信息 (为什么它不起作用)</h4>
<p>很多人认为在HTTP头信息中设置了Pragma: no-cache后会让内容无法被缓存。但事实并非如此：HTTP的规范中，响应型头信息没有任何关于Pragma属性的说明，而讨论了的是请求型头信息 Pragma属性（头信息也由浏览器发送给服务器），虽然少数集中缓存服务器会遵循这个头信息，但大部分不会。用了Pragma也不起什么作用，要用就使用下列头信息：</p>
<h4>使用Expires（过期时间）HTTP头信息来控制保鲜期</h4>
<p>Expires（过期时间） 属性是HTTP控制缓存的基本手段，这个属性告诉缓存器：相关副本在多长时间内是新鲜的。过了这个时间，缓存器就会向源服务器发送请求，检查文档是否被修改。几乎所有的缓存服务器都支持Expires（过期时间）属性；<br>
<br>
大部分Web服务器支持你用几种方式设置Expires属性；一般的：可以设计一个绝对时间间隔：基于客户最后查看副本的时间（最后访问时间）或者根据服务器上文档最后被修改的时间；</p>
<p>Expires 头信息：对于设置静态图片文件（例如导航栏和图片按钮）可缓存特别有用；因为这些图片修改很少，你可以给它们设置一个特别长的过期时间，这会使你的网站对用户变得相应非常快；他们对于控制有规律改变的网页也很有用，例如：你每天早上6点更新新闻页，你可以设置副本的过期时间也是这个时间，这样缓存服务器就知道什么时候去取一个更新版本，而不必让用户去按浏览器的&ldquo;刷新&rdquo;按钮。</p>
<p>过期时间头信息属性值<strong>只能</strong>是HTTP格式的日期时间，其他的都会被解析成当前时间&ldquo;之前&rdquo;，副本会过期，记住：HTTP的日期时间必须是格林威治时间（GMT），而不是本地时间。举例：</p>
<div style="margin-left: 40px"><span style="font-style: italic">Expires: Fri, 30 Oct 1998 14:19:41 GMT</span></div>
<p>所以使用过期时间属性一定要确认你的Web服务器时间设置正确，一个途径是通过网络时间同步协议（Network Time Protocol NTP），和你的系统管理员那里你可以了解更多细节。<br>
虽然过期时间属性非常有用，但是它还是有些局限，首先：是牵扯到了日期，这样Web服务器的时间和缓存服务器的时间必须是同步的，如果有些不同步，要么是应该缓存的内容提前过期了，要么是过期结果没及时更新。<br>
还有一个过期时间设置的问题也不容忽视：如果你设置的过期时间是一个固定的时间，如果你返回内容的时候又没有连带更新下次过期的时间，那么之后所有访问请求都会被发送给源Web服务器，反而增加了负载和响应时间；</p>
<h4>Cache-Control（缓存控制） HTTP头信息</h4>
<p>HTTP 1.1介绍了另外一组头信息属性：Cache-Control响应头信息，让网站的发布者可以更全面的控制他们的内容，并定位过期时间的限制。<br>
有用的 Cache-Control响应头信息包括：</p>
<ul>
    <li><strong>max-age</strong>=[秒] &mdash; 执行缓存被认为是最新的最长时间。类似于过期时间，这个参数是基于请求时间的相对时间间隔，而不是绝对过期时间，[秒]是一个数字，单位是秒：从请求时间开始到过期时间之间的秒数。</li>
    <li><strong>s-maxage</strong>=[秒] &mdash; 类似于max-age属性，除了他应用于共享（如：代理服务器）缓存</li>
    <li><strong>public </strong>&mdash; 标记认证内容也可以被缓存，一般来说： 经过HTTP认证才能访问的内容，输出是自动不可以缓存的；</li>
    <li><strong>no-cache</strong> &mdash; 强制每次请求直接发送给源服务器，而不经过本地缓存版本的校验。这对于需要确认认证应用很有用（可以和public结合使用），或者严格要求使用最新数据的应用（不惜牺牲使用缓存的所有好处）；</li>
    <li><strong>no-store</strong> &mdash; 强制缓存在任何情况下都不要保留任何副本</li>
    <li><strong>must-revalidate</strong> &mdash; 告诉缓存必须遵循所有你给予副本的新鲜度的，HTTP允许缓存在某些特定情况下返回过期数据，指定了这个属性，你高速缓存，你希望严格的遵循你的规则。</li>
    <li><strong>proxy-revalidate</strong> &mdash; 和 must-revalidate类似，除了他只对缓存代理服务器起作用</li>
</ul>
<p>举例:</p>
<div style="font-style: italic; margin-left: 40px">Cache-Control: max-age=3600, must-revalidate</div>
<p>如果你计划试用Cache-Control属性，你应该看一下这篇HTTP文档，详见参考和深入阅读；</p>
<h4>校验参数和校验</h4>
<p>在Web缓存如何工作： 我们说过：校验是当副本已经修改后，服务器和缓存之间的通讯机制；使用这个机制：缓存服务器可以避免副本实际上仍然足够新的情况下重复下载整个原件。<br>
校验参数非常重要，如果1个不存在，并且没有任何信息说明保鲜期（Expires或Cache-Control）的情况下，缓存将不会存储任何副本；<br>
最常见的校验参数是文档的最后修改时间，通过最后Last-Modified头信息可以，当一份缓存包含Last-Modified信息，他基于此信息，通过添加一个If-Modified-Since请求参数，向服务器查询：这个副本从上次查看后是否被修改了。<br>
HTTP 1.1介绍了另外一个校验参数： ETag，服务器是服务器生成的唯一标识符ETag，每次副本的标签都会变化。由于服务器控制了ETag如何生成，缓存服务器可以通过If-None-Match请求的返回没变则当前副本和原件完全一致。<br>
所有的缓存服务器都使用Last-Modified时间来确定副本是否够新，而ETag校验正变得越来越流行；<br>
所有新一代的Web服务器都对静态内容（如：文件）自动生成ETag和Last-Modified头信息，而你不必做任何设置。但是，服务器对于动态内容（例如：CGI,ASP或数据库生成的网站）并不知道如何生成这些信息，参考一下编写利于缓存的脚本章节；</p>
<h3>创建利于缓存网站的窍门</h3>
<p>除了使用新鲜度信息和校验，你还有很多方法使你的网站缓存友好。</p>
<ul>
    <li><strong>保持URL稳定</strong>： 这是缓存的金科玉律，如果你给在不同的页面上，给不同用户或者从不同的站点上提供相同的内容，应该使用相同的URL，这是使你的网站缓存友好最简单，也是 最高效的方法。例如：如果你在页面上使用 &quot;/index.html&quot; 做为引用，那么就一直用这个地址；</li>
    <li><strong>使用一个共用的库</strong>存放每页都引用的图片和其他页面元素；</li>
    <li><strong>对于不经常改变的图片/页面启用缓存</strong>，并使用Cache-Control: max-age属性设置一个较长的过期时间；</li>
    <li><strong>对于定期更新的内容</strong>设置一个缓存服务器可识别的max-age属性或过期时间；</li>
    <li><strong>如果数据源（特别是下载文件）变更，修改名称</strong>，这样：你可以让其很长时间不过期，并且保证服务的是正确的版本；而链接到下载文件的页面是一个需要设置较短过期时间的页面。</li>
    <li><strong>万不得已不要改变文件</strong>，否则你会提供一个非常新的Last-Modified日期；例如：当你更新了网站，不要复制整个网站的所有文件，只上传你修改的文件。</li>
    <li><strong>只在必要的时候使用Cookie</strong>，cookie是非常难被缓存的，而且在大多数情况下是不必要的，如果使用cookie，控制在动态网页上；</li>
    <li><strong>减少试用SSL</strong>，加密的页面不会被任何共享缓存服务器缓存，只在必要的时候使用，并且在SSL页面上减少图片的使用；</li>
    <li><strong>使用可缓存性评估引擎</strong>，这对于你实践本文的很多概念都很有帮助；</li>
</ul>
<h3>编写利于缓存的脚本</h3>
<p>脚本缺省不会返回校验参数（返回Last-Modified或ETag头信息）或其他新鲜度信息（Expires或Cache-Control），有些动 态脚本的确是动态内容（每次相应内容都不一样），但是更多（搜索引擎，数据库引擎网站）网站还是能从缓存友好中获益的。<br>
一般说来，如果脚本生成的输出在未来一段时间（几分钟或者几天）都是可重复复制的，那么就是可缓存的。如果脚本输出内容只随URL变化而变化，也是可缓存的；但如果输出会根据cookie，认证信息或者其他外部条件变化，则还是不可缓存的。</p>
<ul>
    <li>最利于缓存的脚本就是将内容改变时导出成静态文件，Web服务器可以将其当作另外一个网页并生成和试用校验参数，让一些都变得更简单，只需要写入文件即可，这样最后修改时间也有了；</li>
    <li>另外一个让脚本可缓存的方法是对一段时间内能保持较新的内容设置一个相对寿命的头信息，虽然通过Expires头信息也可以实现，但更容易的是用Cache-Control: max-age属性，它会让首次请求后一段时间内缓存保持新鲜；</li>
    <li>如果以上做法你都做不到，你可以让脚本生成一个校验属性，并对 If-Modified-Since 和/或If-None-Match请求作出反应，这些属性可以从解析HTTP头信息得到，并对符合条件的内容返回304 Not Modified（内容未改变），可惜的是，这种做法比不上前2种高效；</li>
</ul>
<p>其他窍门：</p>
<ul>
    <li>尽量避免使用POST，除非万不得已，POST模式的返回内容不会被大部分缓存服务器保存，如果你发送内容通过URL和查询（通过GET模式）的内容可以缓存下来供以后使用；</li>
    <li>不要在URL中加入针对每个用户的识别信息：除非内容是针对每个用户不同的；</li>
    <li>不要统计一个用户来自一个地址的所有请求，因为缓存常常是一起工作的；</li>
    <li>生成并返回Content-Length头信息，如果方便的话，这个属性让你的脚本在可持续链接模式时：客户端可以通过一个TCP/IP链接同时请求多个副本，而不是为每次请求单独建立链接，这样你的网站相应会快很多；</li>
</ul>
具体定义请参考实现章节。
<h3>常见问题解答</h3>
<h4>让网站变得可缓存的要点是什么？</h4>
<p>好的策略是确定那些内容最热门，大量的复制（特别是图片）并针对这些内容先部署缓存。</p>
<h4>如何让页面通过缓存达到最快相应？</h4>
<p>缓存最好的副本是那些可以长时间保持新鲜的内容；基于校验虽然有助于加快相应，但是它不得不和源服务器联系一次去检查内容是否够新，如果缓存服务器上就知道内容是新的，内容就可以直接相应返回了。</p>
<h4>我理解缓存是好的，但是我不得不统计多少人访问了我的网站！</h4>
<p>如果你必须知道每次页面访问的，选择【一】个页面上的小元素，或者页面本身，通过适当的头信息让其不可缓存，例如： 可以在每个页面上部署一个1x1像素的透明图片。Referer头信息会有包含这个图片的每个页面信息；<br>
明确一点：这个并不会给你一个关于你用户精确度很高的统计，而且这对互联网和你的用户这都不太好，消耗了额外的带宽，强迫用户去访问无法缓存的内容。了解更多信息，参考访问统计资料。</p>
<h4>我如何能看到HTTP头信息的内容？</h4>
<p>很多浏览器在页面属性或类似界面中可以让你看到Expires 和Last-Modified信息；如果有的话：你会找到页面信息的菜单和页面相关的文件（如图片），并且包含他们的详细信息；<br>
看到完整的头信息，你可以用telnet手工连接到Web服务器；<br>
为此：你可能需要用一个字段指定端口（缺省是80），或者链接到www.example.com:80 或者 www.example.com 80(注意是空格)，更多设置请参考一下telnet客户端的文档；<br>
打开网站链接：请求一个查看链接，如果你想看到http://www.example.com/foo.html 连接到www.example.com的80端口后，键入：</p>
<div style="margin-left: 40px"><span style="font-style: italic">GET /foo.html HTTP/1.1 [回车]</span><br>
<span style="font-style: italic">GET /foo.html HTTP/1.1 [return]</span><br>
<span style="font-style: italic">Host: www.example.com [回车][回车] </span><br>
<span style="font-style: italic">Host: www.example.com [return][return]</span></div>
<p>在[回车]处按键盘的回车键；在最后，要按2次回车，然后，就会输出头信息及完整页面，如果只想看头信息，将GET换成HEAD。</p>
<h4>我的页面是密码保护的，代理缓存服务器如何处理他们？</h4>
<p>缺省的，网页被HTTP认证保护的都是私密内容，它们不会被任何共享缓存保留。但是，你可以通过设置Cache-Control: public让认证页面可缓存，HTTP 1.1标准兼容的缓存服务器会认出它们可缓存。<br>
如果你认为这些可缓存的页面，但是需要每个用户认证后才能看，可以组合使用Cache-Control: public和no-cache头信息，高速缓存必须在提供副本之前，将将新客户的认证信息提交给源服务器。设置就是这样：</p>
<blockquote><em>Cache-Control: public, no-cache</em><br>
</blockquote>
<p>无论如何：这是减少认证请求的最好方法，例如： 你的图片是不机密的，将它们部署在另外一个目录，并对此配置服务器不强制认证。这样，那些图片会缺省都缓存。</p>
<h4>我们是否要担心用户通过cache访问我的站点？</h4>
<p>代理服务器上SSL页面不会被缓存（不推荐被缓存），所以你不必为此担心。但是，由于缓存保存了非SSL请求和从他们抓取的URL，你要意识到没有安全保护的网站，可能被不道德的管理员可能搜集用户隐私，特别是通过URL。<br>
实际上，位于服务器和客户端之间的管理员可以搜集这类信息。特别是通过CGI脚本在通过URL传递用户名和密码的时候会有很大问题；这对泄露用户名和密码是一个很大的漏洞；<br>
如果你初步懂得互联网的安全机制，你不会对缓存服务器有任何。</p>
<h4>我在寻找一个包含在Web发布系统解决方案，那些是比较有缓存意识的系统？</h4>
<p>这很难说，一般说来系统越复杂越难缓存。最差就是全动态发布并不提供校验参数；你无发缓存任何内容。可以向系统提供商的技术人员了解一下，并参考后面的实现说明。</p>
<h4>我的图片设置了1个月后过期，但是我现在需要现在更新。</h4>
<p>过期时间是绕不过去的，除非缓存（浏览器或者代理服务器）空间不足才会删除副本，缓存副本在过期之间会被一直使用。<br>
最好的办法是改变它们的链接，这样，新的副本将会从源服务器上重新下载。记住：引用它们的页面本身也会被缓存。因此，使用静态图片和类似内容是很容易缓存的，而引用他们的HTML页面则要保持非常更新；<br>
如果你希望对指定的缓存服务器重新载入一个副本，你可以强制使用&ldquo;刷新&rdquo;（在FireFox中在reload的时候按住shift键：就会有前面提到恶Pragma: no-cache头信息发出）。或者你可以让缓存的管理员从他们的界面中删除相应内容；</p>
<h4>我运行一个Web托管服务，如何让我的用户发布缓存友好的网页？</h4>
<p>如果你使用apahe，可以考虑允许他们使用.htaccess文件并提供相应的文档；<br>
另外一方面： 你也可以考虑在各种虚拟主机上建立各种缓存策略。例如： 你可以设置一个目录 /cache-1m 专门用于存放访问1个月的访问，另外一个 /no-cache目录则被用提供不可存储副本的服务。<br>
无论如何：对于大量用户访问还是应该用缓存。对于大网站，这方面的节约很明显（带宽和服务器负载）；</p>
<h4>我标记了一些网页是可缓存的，但是浏览器仍然每次发送请求给服务。如何强制他们保存副本？</h4>
<p>缓存服务器并不会总保存副本并重用副本；他们只是在特定情况下会不保存并使用副本。所有的缓存服务器都回基于文件的大小，类型（例如：图片 页面），或者服务器空间的剩余来确定如何缓存。你的页面相比更热门或者更大的文件相比，并不值得缓存。<br>
所以有些缓存服务器允许管理员根据文件类型确定缓存副本的优先级，允许某些副本被永久缓存并长期有效；</p>
<h3>缓存机制的实现 - Web服务器端配置</h3>
<p>一般说来，应该选择最新版本的Web服务器程序来部署。不仅因为它们包含更多利于缓存的功能，新版本往往在性能和安全性方面都有很多的改善。</p>
<h4>Apache HTTP服务器</h4>
<p>Apache有些可选的模块来包含这些头信息： 包括Expires和Cache-Control。 这些模块在1.2版本以上都支持；<br>
这些模块需要和apache一起编译；虽然他们已经包含在发布版本中，但缺省并没有启用。为了确定相应模块已经被启用：找到httpd程序并运行httpd -l 它会列出可用的模块，我们需要用的模块是mod_expires和mod_headers</p>
<ul>
    <li>如果这些模块不可用，你需要联系管理员，重新编译并包含这些模块。这些模块有时候通过配置文件中把注释掉的配置启用，或者在编译的时候增加-enable -module=expires和-enable-module=headers选项（在apache 1.3和以上版本）。参考Apache发布版中的INSTALL文件；</li>
</ul>
<p>Apache一旦启用了相应的模块，你就可以在.htaccess文件或者在服务器的access.conf文件中通过mod_expires设置副本什 么时候过期。你可设置过期从访问时间或文件修改时间开始计算，并且应用到某种文件类型上或缺省设置，参考<a href="http://httpd.apache.org/docs/1.3/mod/mod_expires.html">模块的文档</a>获得更多信息，或者遇到问题的时候向你身边的apache专家讨教。<br>
应用Cache-Control头信息，你需要使用mod_headers,它将允许你设置任意的HTTP头信息，参考<a href="http://httpd.apache.org/docs/1.3/mod/mod_headers.html">mod_headers的文档</a>可以获得更多资料；<br>
这里有个例子说明如何使用头信息：</p>
<ul>
    <li>.htaccess文件允许web发布者使用命令只在配置文件中用到的命令。他影响到所在目录及其子目录；问一下你的服务器管理员确认这个功能是否启用了。</li>
</ul>
<div style="margin-left: 40px"><span style="font-style: italic">### 启用 mod_expires</span><br>
<span style="font-style: italic">ExpiresActive On</span><br>
<span style="font-style: italic">### 设置 .gif 在被访问过后1个月过期。</span><br>
<span style="font-style: italic">ExpiresByType image/gif A2592000</span><br>
<span style="font-style: italic">### 其他文件设置为最后修改时间1天后过期</span><br>
<span style="font-style: italic">### (用了另外的语法)</span><br>
<span style="font-style: italic">ExpiresDefault &quot;modification plus 1 day&quot;</span><br>
<span style="font-style: italic">### 在index.html文件应用 Cache-Control头属性</span><br>
<span style="font-style: italic">&lt;Files index.html&gt;</span><br>
<span style="font-style: italic">Header append Cache-Control &quot;public, must-revalidate&quot;</span><br>
<span style="font-style: italic">&lt;/Files&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<ul>
    <li>注意： 在适当情况下mod_expires会自动计算并插入Cache-Control:max-age 头信息</li>
</ul>
<p>Apache 2.0的配置和1.3类似，更多信息可以参考2.0的<a href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html">mod_expires</a>和<a href="http://httpd.apache.org/docs/2.2/mod/mod_headers.html">mod_headers文档</a>；</p>
<h4>Microsoft IIS服务器</h4>
<p>Microsoft的IIS可以非常容易的设置头信息，注意：这只针对IIS 4.0服务器，并且只能在NT服务器上运行。<br>
为网站的一个区域设置头信息，先要到管理员工具界面中，然后设置属性。选择HTTP Header选单，你会看到2个有趣的区域：启用内容过期和定制HTTP头信息。头一个设置会自动配置，第二个可以用于设置Cache-Control头信息；<br>
设置asp页面的头信息可以参考后面的ASP章节，也可以通过ISAPI模块设置头信息，细节请参考MSDN。</p>
<h4>Netscape/iPlanet企业服务器</h4>
<p>3.6版本以后，Netscape/iPlanet已经不能设置Expires头信息了，他从3.0版本开始支持HTTP 1.1的功能。这意味着HTTP 1.1的缓存（代理服务器/浏览器）优势都可以通过你对Cache-Control设置来获得。<br>
使用Cache-Control头信息，在管理服务器上选择内容管理|缓存设置目录。然后：使用资源选择器，选择你希望设置头信息的目录。设置完头信息后，点击&ldquo;OK&rdquo;。更多信息请参考<a href="http://developer.netscape.com/docs/manuals/enterprise/admnunix/content.htm#1006282">Netscape/iPlanet企业服务器的手册</a>。</p>
<h4>缓存机制的实现：服务器端脚本</h4>
<p>需要注意的一点是：也许服务器设置HTTP头信息比脚本语言更容易，但是两者你都应该使用。<br>
因为服务器端的脚本主要是为了动态内容，他本身不产生可缓存的文件页面，即使内容实际是可以缓存的。如果你的内容经常改变，但是不是每次页面请求都改变，考虑设置一个Cache-Control: max-age头信息；大部分用户会在短时间内多次访问同一页面。例如：用户点击&ldquo;后退&rdquo;按钮，即使没有新内容，他们仍然要再次从服务器下载内容查看。</p>
<h4>CGI程序</h4>
<p>CGI脚本是生成内容最流行的方式之一，你可以很容易在发送内容之前的扩展HTTP头信息；大部分CGI实现都需要你写 Content-Type头信息，例如这个Perl脚本：</p>
<div style="margin-left: 40px"><span style="font-style: italic">#!/usr/bin/perl</span><br>
<span style="font-style: italic">print &quot;Content-type: text/html\n&quot;;</span><br>
<span style="font-style: italic">print &quot;Expires: Thu, 29 Oct 1998 17:04:19 GMT\n&quot;;</span><br>
<span style="font-style: italic">print &quot;\n&quot;;</span><br>
<span style="font-style: italic">### 后面是内容体...</span></div>
<p>由于都是文本，你可以很容易通过内置函数生成Expires和其他日期相关的头信息。如果你使用Cache-Control: max-age;会更简单；</p>
<div style="margin-left: 40px"><span style="font-style: italic">print &quot;Cache-Control: max-age=600\n&quot;;</span></div>
<p>这样脚本可以在被请求后缓存10分钟；这样用户如果按&ldquo;后退&rdquo;按钮，他们不会重新提交请求；<br>
CGI的规范同时也允许客户端发送头信息，每个头信息都有一个&lsquo;HTTP_&rsquo;的前缀；这样如果一个客户端发送一个If-Modified-Since请求，就是这样的：</p>
<div style="font-style: italic; margin-left: 40px">HTTP_IF_MODIFIED_SINCE = Fri, 30 Oct 1998 14:19:41 GMT</div>
<p><br>
参考一下<a href="http://www.mnot.net/cgi_buffer/">cgi_buffer</a>库，一个自动处理ETag的生成和校验的库，生成Content-Length属性和对内容进行gzip压缩。在Python脚本中也只需加入一行；</p>
<h4>服务器端包含 Server Side Includes</h4>
<p>SSI（经常使用.shtml扩展名）是网站发布者最早可以生成动态内容的方案。通过在页面中设置特别的标记，也成为一种嵌入HTML的脚本；<br>
大部分SSI的实现无法设置校验器，于是无法缓存。但是Apache可以通过对特定文件的组执行权限设置实现允许用户设置那种SSI可以被缓存；结合XbitHack调整整个目录。更多文档请参考<a href="http://httpd.apache.org/docs/1.3/mod/mod_include.html">mod_include文档</a>。</p>
<h4>PHP</h4>
<p>PHP是一个内建在web服务器中的服务器端脚本语言，当做为HTML嵌入式脚本，很像SSI，但是有更多的选项，PHP可以在各种Web服务器上设置为CGI模式运行，或者做为Apache的模块；<br>
缺省PHP生成副本没有设置校验器，于是也无法缓存，但是开发者可以通过Header()函数来生成HTTP的头信息；<br>
例如：以下代码会生成一个Cache-Control头信息，并设置为3天以后过期的Expires头信息；</p>
<div style="margin-left: 40px"><span style="font-style: italic">&lt;?php</span><br>
<span style="font-style: italic">Header(&quot;Cache-Control: must-revalidate&quot;);</span><br>
<br>
<span style="font-style: italic">$offset = 60 * 60 * 24 * 3;</span><br>
<span style="font-style: italic">$ExpStr = &quot;Expires: &quot; . gmdate(&quot;D, d M Y H:i:s&quot;, time() + $offset) . &quot; GMT&quot;;</span><br>
<span style="font-style: italic">Header($ExpStr);</span><br>
<span style="font-style: italic">?&gt;</span></div>
<p>记住： Header()的输出必须先于所有其他HTML的输出；<br>
正如你看到的：你可以手工创建HTTP日期；PHP没有为你提供专门的函数（新版本已经让这个越来越容易了，请参考PHP的<a href="http://php.net/date">日期相关函数文档</a>），当然，最简单的还是设置Cache-Control: max-age头信息，而且对于大部分情况都比较适用；<br>
更多信息，请参考<a href="http://www.php.net/manual/function.header.php3">header相关的文档</a>；<br>
也请参考一下<a href="http://www.mnot.net/cgi_buffer/">cgi_buffer</a>库，自动处理ETag的生成和校验，Content-Length生成和内容的gzip压缩，PHP脚本只需包含1行代码；</p>
<h4>Cold Fusion</h4>
<p><a href="http://www.adobe.com/products/coldfusion/">Cold Fusion</a>是Macromedia的商业服务器端脚本引擎，并且支持多种Windows平台，Linux平台和多种Unix平台。Cold Fusion通过CFHEADER标记设置HTTP头信息相对容易。可惜的是：以下的Expires头信息的设置有些容易误导；</p>
<div style="margin-left: 40px"><span style="font-style: italic">&lt;CFHEADER NAME=&quot;Expires&quot; VALUE=&quot;#Now()#&quot;&gt;</span></div>
<p>它并不像你想像的那样工作，因为时间（本例中为请求发起的时间）并不会被转换成一个符合HTTP时间，而且打印出副本的Cold fusion的日期/时间对象，大部分客户端会忽略或者将其转换成1970年1月1日。<br>
但是：Cold Fusion另外提供了一套日期格式化函数， GetHttpTimeSTring. 结合DateAdd函数，就很容易设置过期时间了，这里我们设置一个Header声明副本在1个月以后过期；</p>
<div style="margin-left: 40px"><span style="font-style: italic">&lt;cfheader name=&quot;Expires&quot; value=&quot;#GetHttpTimeString(DateAdd('m', 1, Now()))#&quot;&gt;</span></div>
<p>你也可以使用CFHEADER标签来设置Cache-Control: max-age等其他头信息；<br>
记住：Web服务器也会将头信息设置转给Cold Fusion(做为CGI运行的时候)，检查你的服务器设置并确定你是否可以利用服务器设置代替Cold Fusion。</p>
<h4>ASP和ASP.NET</h4>
<p>在asp中设置HTTP头信息是：确认Response方法先于HTML内容输出前被调用，或者使用 Response.Buffer暂存输出；同样的：注意某些版本的IIS缺省设置会输出Cache-Control: private 头信息，必须声明成public才能被共享缓存服务器缓存。<br>
IIS的ASP和其他web服务器都允许你设置HTTP头信息，例如： 设置过期时间，你可以设置Response对象的属性；</p>
<div style="margin-left: 40px"><span style="font-style: italic">&lt;% Response.Expires=1440 %&gt;</span></div>
<p>设置请求的副本在输出的指定分钟后过期，类似的：也可以设置绝对的过期时间（确认你的HTTP日期格式正确）</p>
<div style="margin-left: 40px"><span style="font-style: italic">&lt;% Response.ExpiresAbsolute=#May 31,1996 13:30:15 GMT# %&gt;</span></div>
<p>Cache-Control头信息可以这样设置：</p>
<div style="font-style: italic; margin-left: 40px">&lt;% Response.CacheControl=&quot;public&quot; %&gt;</div>
<p>在ASP.NET中，Response.Expires 已经不推荐使用了，正确的方法是通过Response.Cache设置Cache相关的头信息；</p>
<div style="margin-left: 40px"><span style="font-style: italic">Response.Cache.SetExpires ( DateTime.Now.AddMinutes ( 60 ) ) ;</span><br>
<span style="font-style: italic">Response.Cache.SetCacheability ( HttpCacheability.Public ) ;</span></div>
<p>参考<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspoutputcache.asp">MSDN文档</a>可以找到更多相关新年系；</p>
<h3>参考文档和深入阅读</h3>
<h4><a target="_blank" href="http://www.ietf.org/rfc/rfc2616.txt">HTTP 1.1 规范定义</a></h4>
<p>HTTP 1.1的规范有大量的扩展用于页面缓存，以及权威的接口实现指南，参考章节：13, 14.9, 14.21, 以及 14.25.</p>
<h4><a target="_blank" href="http://www.web-caching.com/">Web-Caching.com</a></h4>
<p>非常精彩的介绍缓存相关概念，并介绍其他在线资源。<br>
<a target="_blank" href="http://www.goldmark.org/netrants/webstats/"><br>
</a></p>
<h4><a target="_blank" href="http://www.goldmark.org/netrants/webstats/">关于非连续性访问统计</a></h4>
<p>Jeff Goldberg内容丰富的演说告诉你为什么不应该过度依赖访问统计和计数器；</p>
<h4><a href="http://www.mnot.net/cacheability/">可缓存性检测引擎</a></h4>
<p>可缓存的引擎设计，检测网页并确定其如何与Web缓存服务器交互， 这个引擎配合这篇指南是一个很好的调试工具，</p>
<h4><a href="http://www.mnot.net/cgi_buffer/">cgi_buffer库</a></h4>
<p>包含库：用于CGI模式运行的Perl/Python/PHP脚本，自动处理ETag生成/校验，Content-Length生成和内容压缩。正确地。 Python版本也被用作其他大量的CGI脚本。</p>
<h3>关于本文档</h3>
<p>本文版权属于Mark Nottingham &lt;<a href="mailto:mnot@pobox.com">mnot@pobox.com</a>&gt;，本作品遵循<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh">创作共用版权</a>。<br>
如果你镜像本文，请通过以上邮件告知，这样你可以在更新时被通知；<br>
所有的商标属于其所有人。<br>
虽然作者确信内容在发布时的正确性，但不保证其应用或引申应用的正确性，如有误传，错误或其他需要澄清的问题请尽快告知作者；<br>
本文最新版本可以从 <a href="http://www.mnot.net/cache_docs/">http://www.mnot.net/cache_docs/</a> 获得；<br>
翻译版本包括： <a href="http://www.jakpsatweb.cz/clanky/caching-tutorial-czech-translation.html">捷克语版</a>，<a href="http://www.mnot.net/cache_docs/index.fr.html">法语版</a>和<a href="http://www.chedong.com/tech/cache_docs.html">中文版</a>。<br>
版本： 1.81 - 2007年3月16日<br>
<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh">创作共用版权声明</a></p>
</div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/%CD%F8%D5%BE%C7%B0%B6%CB%D0%D4%C4%DC%D3%C5%BB%AF">网站前端性能优化</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/47010b347aff59315bb5f5fe.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  10:46</pubDate>
        <category><![CDATA[网站前端性能优化]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/47010b347aff59315bb5f5fe.html</guid>
</item>

<item>
        <title><![CDATA[Web中的各种图像格式优缺点分析：PNG、gif、jpg、SVG]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/a286e8ef185c113cacafd5ef.html]]></link>
        <description><![CDATA[
		
		<p>PNG是一种可携式网络图像格式。PNG一开始便结合GIF及JPG两家之长，打算一举取代这两种格式。1996年10月1日由PNG向国际网络联盟提出并得到推荐认可标准，并且大部分绘图软件和浏览器开始支持PNG图像浏览，从此PNG图像格式生机焕发。 　　</p>
<p>IE浏览器从4.0版本开始支持png图像浏览。 　　</p>
<p><strong>特点1：兼有gif和jpg的色彩模式。</strong> 　　</p>
<p>我们知道gif格式图像采用了256色以下的index color色彩模式，jpg采用的是24位真彩模式。png不仅能储存256色以下的index color图像，还能储存24位真彩图像，甚至能最高可储存至48位超强色彩图像。 　　</p>
<p><strong>特点2：png能把图像文件压缩到极限以利于网络传输，但又能保留所有与图像品质有关的信息。</strong> 　　</p>
<p>如果你的图像是以文字、形状及线条为主，png会用类似gif的压缩方法来得到较好的压缩率，而且不破坏原始图像的任何细节。据国际网络联盟测算，八位的png图像比同位的gif图像就小10%到30%。 　　</p>
<p>而对于相片品质一类的压缩，png则采用类似jpg的压缩演算法。但是jpg压缩程度越大、影像的品质越差。因为它的压缩是采用的是破坏性压缩法、每次压缩的同时便多多少少漏掉一些像素。 png不同于jpg的地方在于：它处理相片类图像亦是采用非破坏性压缩，图像压缩后能保持与压缩前图像质量一样，没有一点失真。 　　</p>
<p><strong>特点3：更优化的传输显示。</strong> 　　</p>
<p>熟悉gif格式的图像处理者知道，gif图像有两种模式&mdash;&mdash;normal(普通)模式和interlaced(交错)模式。interlaced模式更适用于网络传输。在传送图像过程中，浏览者先看到图像一个大略的轮廓然后再慢慢清晰。png也采取了interlaced模式，使图像得以水平及垂直方式显像在萤幕上，加快了下载的速度。</p>
<p><strong>特点4：支持图像透明显示。</strong> 　　</p>
<p>gif格式虽然也支持透明显示，采用gif格式透明图像过于刻板，因为gif透明图像只有1与0的透明信息、只有透明或不透明两种选择，没有层次；而png提供了α频段0至255的透明信息，可以使图像的透明区域出现深度不同的层次。 　　</p>
<p>png图像就可以让图像覆盖在任何背景上都看不到接缝，改善gif透明图像描边不佳的问题。 　　</p>
<p><strong>特点5：兼容性较好。</strong> 　　</p>
<p>gif图像在不同系统上所显示的画面也会跟着不一样，但png却可以让你在Macintosh上制作的图像与在Windows上所显示的图像完全相同，反之亦然。 png被设计成可以通过网络传送到任何机种及作业系统上读取。 　　</p>
<p>文字资料(如作者、出处)、储存遮罩(MASK)、伽玛值、色彩校正码等信息均可参杂在 png图像中一起传输。 　　</p>
<p><strong>几个发现：</strong> 　　</p>
<p>1. 不透明和索引色透明的图片， png8比gif更加具有优势。 　　</p>
<p>2. Alpha透明的图片，png8比gif显示效果好，但文件更大。 　　</p>
<p>3. png24没有透明效果：包括索引色透明和Alpha透明。 　　</p>
<p>4. 不同的浏览器，显示效果不一样。 　　</p>
<p>5. Firefox：支持png8的索引色透明度， png8 和png32的alpha透明度。　　</p>
<p>6. IE：支持png8的索引色透明度，但不支持png8和png32的alpha透明度。(可用Js＋css滤镜解决) 　　</p>
<p>7. 网页中使用的照片类图片，jpg文件一般比png24要小很多。但不排除特殊情况。 　　</p>
<p> </p>
<p><strong>SVG 图像格式</strong> 　　</p>
<p>SVG是种一种可缩放的矢量图形。它是基于XML，由W3C联盟进行开发的。严格来说应该是一种开放标准的矢量图形语言，可让你设计激动人心的、高分辨率的Web图形页面。 　　</p>
<p>用户可以直接用代码来描绘图像，可以用任何文字处理工具打开SVG图像，通过改变部分代码来使图像具有交互功能，并可以随时插入到HTML中通过浏览器来观看。 　　</p>
<p>SVG提供了目前网络流行格式GIF和JPEG无法具备了优势：可以任意放大图形显示，但绝不会以牺牲图像质量为代价； 　　</p>
<p>文字在SVG图像中保留可编辑和可搜寻的状态；平均来讲，SVG文件比JPG和GIF格式的文件要小很多，因而下载也很快。</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/%C4%DA%C8%DD%5F%CD%BC%C6%AC%D3%C5%BB%AF">内容_图片优化</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/a286e8ef185c113cacafd5ef.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  10:26</pubDate>
        <category><![CDATA[内容_图片优化]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/a286e8ef185c113cacafd5ef.html</guid>
</item>

<item>
        <title><![CDATA[HttpWatch的指标说明：Blocked、Connect、Send、Wait、Receive]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/ec15440971792ac53bc7631e.html]]></link>
        <description><![CDATA[
		
		<p><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/seosky/pic/item/d21fb40aad8d483294ca6b78.jpg"></p>
<p><strong>Blocked</strong> time includes any pre-processing time (such as cache lookup) and the time spent waiting for a network connection to become available. Internet Explorer will only create a maximum of two concurrent network connections per host name (i.e. www.microsoft.com) and will queue up requests until a network connection is available. Often the Blocked time is the most significant factor in the download time of images embedded in a web page.<br>
<br>
<strong>闭塞时间</strong>，包括所有的过程之前的时间（像，cache对比）和等待网络链接的时间，IE在每个主机名（像www.microsoft.com）下最多只创建两个当前的网络连接，而且要排队等待直到这个网络链接可用，通常，闭塞时间影响网页中图片加载时间的重要因素。<br>
<br>
<strong>Connect</strong> is the time required to create a TCP connection to the web server (or proxy). If a secure HTTPS connection is being used this time includes the SSL handshake process. Keep-Alive connections are often used to avoid the overhead of repeatedly connecting to the web server.<br>
<br>
<strong>连接时间</strong>，是创建TCP连接到服务器或者代理服务器所花费的时间，如果一个包含SSL的安全的HTTPS连接存在，Keep-Alive链接经常被用到，以避免多次重复的连接WEB服务器。<br>
<br>
<strong>Send</strong> is the time required to send the HTTP request message to the server and will depend on the amount of data that is sent to the server. For example, long Send times will result from uploading files using an HTTP POST<br>
<br>
<strong>发送</strong>，是发送HTTP请求到服务器的时间，而且这个时间取决与发送请求的数据量的大小，例如，长的发送时间是由于用PSOT方式上传文件造成的。<br>
<br>
<strong>Wait</strong> is the idle time spent waiting for a response message from the server. This value includes delays introduced due to network latency and the time required to process the request on the web server.<br>
<br>
<strong>等待</strong>，是花费在等待服务器响应消息的空闲时间，这个值包括网络延迟和服务器处理请求的时间。<br>
<br>
<strong>Receive</strong> is the time taken to read the response message from the server. This value will be depend on the size of the content returned, network bandwidth and whether HTTP compression was used.<br>
<br>
<strong>接收</strong>，是花费在从服务器读取响应消息的时间。这个值可以受到请求消息内容的大小，网络带宽和是否使用了HTTP压缩。<br>
<br>
<strong>Cache Read</strong> is the time taken to read the content from the browser cache during (Cache) or 304 responses.<br>
<br>
<strong>缓存读取</strong>，是花费在从浏览器缓存中读取内容或者304响应的时间。<br>
<br>
<strong>TTFB</strong> (or Time To First Byte) is the duration from the initial network request being initiated by the browser to the first byte being received from the server. It includes TCP connection time, the time to send the request and the time taken to get the first byte of the response message.<br>
<br>
<strong>TTFB</strong>，是最初的网络请求被发起到从服务器接收到第一个字节这段时间，它包含了TCP连接时间，发送HTTP请求时间和获得响应消息第一个字节的时间。<br>
<br>
<strong>Network</strong> is the total duration of all network related operations for an HTTP request.<br>
<br>
<strong>Network</strong>，是所有的对一个HTTP请求的相关操作的这段时间。</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/%CD%F8%D5%BE%C7%B0%B6%CB%D0%D4%C4%DC%D3%C5%BB%AF">网站前端性能优化</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/ec15440971792ac53bc7631e.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  10:02</pubDate>
        <category><![CDATA[网站前端性能优化]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/ec15440971792ac53bc7631e.html</guid>
</item>

<item>
        <title><![CDATA[网页中、网页背景采用大图片还是小图片_前端优化讨论]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/2037a401afc8dddc277fb51d.html]]></link>
        <description><![CDATA[
		
		这的确有点颠覆传统的思维了。以前我们一直以为多个小图片的下载速度之和会小于一个大图片的下载速度。但是现在利用httpwatch工具的对多个页面进行分析后的结果表明事实并不是这样。<br>
第一张图是一个大小为40528bytes的337*191px的大图片的分析结果。<br>
第二张图是一个大小为13883bytes的280*90px的小图片的分析结果。<br>
<div class="floatMPic"><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/seosky/pic/item/a5fa0c2ed38cf67d4ec22669.jpg"><br>
一个大小为40528bytes的337*191px的大图片的分析结果（点击图片可以查看完整大图片）</div>
<br>
<div class="floatMPic"><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/seosky/pic/item/3a2a6f0868b370b80b7b826a.jpg"><br>
一个大小为13883bytes的280*90px的小图片的分析结果（点击图片可以查看完整大图片）</div>
第一张大图片花费时间为：<br>
Blocked：13.034s<br>
Send：0.001s<br>
Wait：0.163s<br>
Receive：4.596s<br>
TTFB：0.164s<br>
NetWork：4.760s<br>
功耗时：17.795s<br>
真正用于传输大文件花费的时间为Reveive时间，即4.596s，多数的时间是用来检索缓存和确定链接是否有效的Blocked时间，供花费13.034s，占总时间的73.2%。<br>
<br>
第二张小图片花费时间为：<br>
Blocked：16.274s<br>
Send：小于0.001s<br>
Wait：0.117s<br>
Receive：0.397s<br>
TTFB：0.118s<br>
NetWork：0.516s<br>
功耗时：16.790s<br>
真正用于传输文件的花费时间是Reveive时间，即0.397s，这的确要比刚才大文件的4.596s小很多。但是他的Blocked时间为16.274s，占总时间的97%。<br>
<br>
如果这些数据还不够说服你的话，让我们看看下面这张图。这里列出了某个网页中所有图片中的花费时间示意图。当然，里面的图片有大有小，规格不一。<br>
<div class="floatMPic"><img class="blogimg" border="0" small="0" src="http://hiphotos.baidu.com/seosky/pic/item/016ef5886283eab9a5c27271.jpg"><br>
大约80%以上的时间是用来检索缓存和确定链接是否有效的Blocked时间。</div>
其中藏青色的为传输文件花费的Reveive时间，而前面白色的为检索缓存和确认链接是否有效的Blocked时间。铁一样的事实告诉我们：
<ul style="list-style-type: square; margin: 5px 2em">
    <li>大文件和小文件下载所需时间的确是不同的，差异的绝对值不大。而且下载所需时间占总耗费时间比例很小。</li>
    <li>大约80%以上的时间是用来检索缓存和确定链接是否有效的Blocked时间。无论文件大小，这个时间的花费大致是相同的。而且所占总耗费时间的比例是极大的。</li>
    <li>一个100k的大图片总耗费时间绝对大于4个25k的小图片的总耗费时间。而且主要差别就是4个小图片的Blocked时间绝对大于1个大图片的Blocked时间。</li>
</ul>
所以如果可能还是使用大图片来替代过多的琐碎的小图片吧。这也是为什么翻转门的效率要高于图片替换实现的滑动门的原因。<br>
但是，请注意：也不能用太大的单张图片，因为那样会影响到用户体验。例如个几兆的背景图片的使用绝对不是一个好主意。 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/%CD%F8%D5%BE%C7%B0%B6%CB%D0%D4%C4%DC%D3%C5%BB%AF">网站前端性能优化</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/2037a401afc8dddc277fb51d.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-16  10:00</pubDate>
        <category><![CDATA[网站前端性能优化]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/2037a401afc8dddc277fb51d.html</guid>
</item>

<item>
        <title><![CDATA[Sitemap中错误命名空间 标记：urlset]]></title>
        <link><![CDATA[http://hi.baidu.com/seosky/blog/item/8d3ca982b429009af603a63a.html]]></link>
        <description><![CDATA[
		
		有的朋友在向Google提交Sitemap的时候经常遇到“错误命名<span class="t_tag" href="tag.php?name=%BF%D5%BC%E4">空间</span>”的错误，其实这大部分是头部没有按标准去做，一些网站程序自动生成Sitemap时也没有指定好，大多是把“www.sitemaps.org”这个地址做成了“www.<span class="t_tag" href="tag.php?name=google">google</span>.com”，造成不该有的错误。<br>
<br>
以下是官方对这个问题做的说明，请参考。<br>
<br>
如果您看到此错误，表明我们检测到您的根元素没有指定默认的命名空间。  <br>
<br>
<strong>命名空间应指定为如下内容：</strong>  <br>
<br>
xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;<br>
<br>
<strong>以下原因可导致此错误：</strong>  <br>
命名空间缺失 <br>
命名空间声明<font color="#ff0000">不正确</font>（例如，命名空间以&quot;.9&quot;结束而不是&quot;0.9&quot;）。<br>
<br>
<strong>Sitemap <span class="t_tag" href="tag.php?name=%CE%C4%BC%FE">文件</span>的开始部分应为如下所示：</strong><br>
<br>
&lt;?xml  version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;urlset  xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;<br>
<br>
<strong>Sitemap  索引文件的开始部分应为如下所示：</strong><br>
<br>
&lt;?xml version=&quot;1.0 &quot;  encoding=&quot;UTF-8&quot;?&gt;&lt;sitemapindex  xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;&gt;<br>
<br>
 
 
 
 
 
<p align="left" style="text-align: left; line-height: 150%;" class="MsoNormal"><font size="5"><strong><span style="font-size: 9pt; line-height: 150%; ">参考：</span></strong></font></p>
<p align="left" style="text-align: left; text-indent: 27pt; line-height: 150%;" class="MsoNormal"><span style="font-size: 9pt; line-height: 150%;"><a href="http://www.sitemaps.org/protocol.php">http://www.sitemaps.org/protocol.php</a><a href="http://www.googlechinawebmaster.com/2008/02/sitemap.html"><br>
</a></span></p>
<p align="left" style="text-align: left; text-indent: 27pt; line-height: 150%;" class="MsoNormal"><span style="font-size: 9pt; line-height: 150%;"><a href="http://www.googlechinawebmaster.com/2008/02/sitemap.html">http://www.googlechinawebmaster.com/2008/02/sitemap.html</a></span></p>
<p align="left" style="text-align: left; text-indent: 27pt; line-height: 150%;" class="MsoNormal"><span style="font-size: 9pt; line-height: 150%;"><a href="http://www.googlechinawebmaster.com/2009/01/sitemap.html">http://www.googlechinawebmaster.com/2009/01/sitemap.html</a></span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/seosky/blog/category/%CD%F8%D5%BE%B5%D8%CD%BC%2Dsitemap">网站地图-sitemap</a>&nbsp;<a href="http://hi.baidu.com/seosky/blog/item/8d3ca982b429009af603a63a.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-09  22:05</pubDate>
        <category><![CDATA[网站地图-sitemap]]></category>
        <author><![CDATA[seosky]]></author>
		<guid>http://hi.baidu.com/seosky/blog/item/8d3ca982b429009af603a63a.html</guid>
</item>


</channel>
</rss>