aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/glossary/第一字节时间/index.html
blob: 8bcc8f0ce9f9d883bbac5a1031a2611373f05486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
title: 第一字节时间
slug: Glossary/第一字节时间
translation_of: Glossary/time_to_first_byte
---
<p><strong>第一字节时间</strong>(TTFB)是指从浏览器请求页面到从浏览器接收来自服务器发送的信息的第一个字节的时间。这一次包括DNS查找和使用(三次)<a href="/en-US/docs/Glossary/TCP">TCP</a>握手和<a href="/en-US/docs/Glossary/SSL_Glossary">SSL</a>握手建立连接(如果请求是通过<a href="https://wiki.developer.mozilla.org/en-US/docs/Glossary/https">https</a>发出的)。</p>



<p>TTFB是从请求开始到响应开始之间所用的时间,以毫秒为单位:</p>

<pre class="notranslate">TTFB = <a href="/en-US/docs/Web/API/PerformanceResourceTiming/responseStart">responseStart</a> - <a href="/en-US/docs/Web/API/PerformanceResourceTiming/requestStart">requestStart</a></pre>

<h2 id="See_Also">See Also:</h2>

<ul>
 <li><a href="/en-US/docs/Web/HTTP/Session">A typical HTTP session</a></li>
 <li><a href="/en-US/docs/Web/API/PerformanceResourceTiming">PerformanceResourceTiming</a></li>
 <li><a href="/en-US/docs/Web/API/PerformanceTiming">PerformanceTiming</a></li>
</ul>