aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/glossary/time_to_first_byte/index.html
blob: 2fbd4fa9340657d3ad0c000257a0f350e381d3ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
title: 第一字节时间
slug: Glossary/time_to_first_byte
translation_of: Glossary/time_to_first_byte
original_slug: Glossary/第一字节时间
---
<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>