Time untuk pertama Byte (TTFB)

What TTFB measures, why ini isn't sebuah Core Web Vital, how ini caps Anda LCP dan FCP, what counts sebagai baik, dan cara fix sebuah slow server respons.

Pertama kali diterbitkan: 26 Jun 2026 · Terakhir diperbarui: 3 Agu 2026 · Advanced
Bahasa

Time untuk pertama Byte adalah time dari start dari sebuah permintaan untuk when pertama byte dari respons arrives — sum dari redirect time, service worker startup, DNS lookup, connection dan TLS negotiation, dan permintaan itself. ini adalah not sebuah Core Web Vital; ini adalah sebuah diagnostic, foundational metric dan sebuah major input untuk FCP dan LCP. web.dev says aim untuk ≤0,8 s (baik) dan treats >1,8 s sebagai poor. ini adalah both sebuah field dan lab metric. Lighthouse's 'Reduce server respons times' audit adalah narrower — ini flags server time di atas ~600 ms, not full TTFB, dan sebagai dari Lighthouse 13 lives inside 'Document permintaan latency' insight. Fix ini dengan sebuah CDN, edge/HTML caching, faster hosting, fewer redirects, Early Hints, dan efficient TLS. dan remember: sebuah tinggi TTFB doesn't selalu berarti sebuah slow situs.

TL;DR — TTFB adalah time dari start dari permintaan untuk when pertama byte dari respons arrives — sum dari redirect time, service worker startup, DNS lookup, connection + TLS negotiation, dan permintaan itself, up untuk itu pertama byte. ini adalah not sebuah Core Web Vital; ini adalah sebuah foundational, diagnostic metric itu feeds FCP dan LCP. web.dev: baik adalah ≤0,8 s, poor adalah >1,8 s (75th percentile). ini adalah both sebuah field dan sebuah lab metric. Lighthouse’s “Reduce server response times” (terjemahan) “Reduce server respons times” audit adalah narrower — ini flags server time di atas ~600 ms, not full TTFB, dan sebagai dari Lighthouse 13 ini lives inside “Document request latency” (terjemahan) “Document permintaan latency” insight. Fix ini dengan sebuah CDN, edge/HTML caching, faster hosting, fewer redirects, 103 Early Hints, dan efficient TLS. dan sebuah tinggi TTFB doesn’t selalu berarti sebuah slow situs.

What TTFB actually measures

TTFB measures time antara starting untuk navigate untuk sebuah halaman dan when pertama byte dari respons begins untuk arrive. thing people get wrong adalah treating ini sebagai pure backend processing time. ini isn’t. ini adalah sum dari everything itu memiliki untuk finish sebelum itu pertama byte dapat come back:

  1. Redirect time
  2. Service worker startup time (jika one applies)
  3. DNS lookup
  4. Connection dan TLS negotiation
  5. ** permintaan** — up until poin pertama byte dari respons memiliki arrived

server processing adalah di there, tetapi so adalah whole connection-setup tax. itu distinction penting moment Anda start reading alat, because mereka don’t semua mengukur yang sama slice (more pada itu below).

Evidence for this claim TTFB measures from request start until the first response byte and includes redirect, connection setup, and server-response time. Scope: Current web.dev navigation TTFB definition. Confidence: high · Verified: web.dev: Time to First Byte

ini adalah not sebuah Core Web Vital

I’ll say ini plainly because ini adalah single sebagian besar umum misconception: TTFB adalah not sebuah Core Web Vital. three Core Web Vitals adalah LCP (memuat), INP (interactivity), dan CLS (visual stability). TTFB adalah sebuah foundational, diagnostic metric — Google’s own framing adalah itu ini adalah “a foundational metric for measuring connection setup time and web server responsiveness in both the lab and the field.” (terjemahan) “sebuah foundational metric untuk measuring connection setup time dan server web responsiveness di both lab dan field.”

Google adalah juga explicit itu Anda tidak strictly memiliki untuk hit baik TTFB threshold: because ini isn’t sebuah Core Web Vital, ini adalah “not absolutely necessary that sites meet the ‘good’ TTFB threshold, provided that it doesn’t impede their ability to score well on the metrics that matter.” (terjemahan) “not absolutely necessary itu situs meet ‘baik’ TTFB threshold, disediakan itu ini doesn’t impede mereka ability untuk score well pada metrics itu penting.” itu last clause adalah catch — untuk sebagian besar situs sebuah buruk TTFB absolutely melakukan impede metrics itu penting.

How ini caps FCP dan LCP

TTFB precedes setiap pengguna-centric memuat metric. Both pertama Contentful Paint dan Largest Contentful Paint sertakan TTFB di mereka pengukuran — clock untuk itu metrics adalah sudah running while Anda wait untuk pertama byte. web.dev breaks LCP ke sub-bagian dan TTFB adalah pertama dari them, which adalah why Anda dapat’t memiliki sebuah fast LCP sitting pada top dari sebuah slow TTFB.

ini adalah juga where dunia nyata data gets pointed. HTTP Archive’s Web Almanac ditemukan itu pada situs dengan poor LCP, TTFB alone adalah eating roughly 2,27 seconds — nearly entire 2,5-kedua “good LCP” (terjemahan) “baik LCP” budget — sebelum apa pun image atau text bahkan started untuk render. jika Anda LCP adalah buruk dan Anda pada-halaman konten looks dioptimalkan, TTFB adalah pertama place I’d look.

So peringkat story adalah indirect tetapi nyata: TTFB adalah not sebuah Google sinyal peringkat ( sinyal peringkat adalah LCP, INP, dan CLS — TTFB isn’t named di itu set). tetapi ini adalah baked ke LCP, which adalah sebuah sinyal peringkat. path runs melalui LCP, not melalui TTFB directly.

Thresholds: baik, perlu improvement, poor

web.dev’s guidance, diukur di 75th percentile dari nyata-pengguna memuat:

  • baik: ≤ 0,8 s
  • Poor: > 1,8 s
Evidence for this claim web.dev recommends a TTFB of 0.8 seconds or less; above 1.8 seconds is poor at the 75th percentile. Scope: Current web.dev TTFB guidance; TTFB is diagnostic, not a Core Web Vital. Confidence: high · Verified: web.dev: Time to First Byte

“Most sites should strive to have a TTFB of 0.8 seconds or less.” (terjemahan) “sebagian besar situs seharusnya strive untuk memiliki sebuah TTFB dari 0,8 seconds atau less.” Worth knowing history: Google moved “good” (terjemahan) “baik” line dari 500 ms untuk 800 ms back di 2022, dan older data adalah recalculated di bawah baru standard — so don’t compare raw historical TTFB angka without memeriksa which threshold mereka digunakan.

600 ms vs 800 ms confusion

ini trips up sebuah lot dari people, so ini adalah worth menjadi precise. ada two berbeda angka floating sekitar:

  • CrUX / web.dev TTFB threshold: 800 ms. ini adalah field threshold untuk full TTFB (DNS + connection + TLS + redirects + server time).
  • Lighthouse “Reduce server response times” (terjemahan) “Reduce server respons times” audit: ~600 ms. ini adalah sebuah lab audit itu flags when browser waits more daripada tentang 600 ms untuk server untuk respond untuk main document permintaan. Crucially, ini measures server respons time hanya — ini melakukan not sertakan DNS, connection setup, atau TLS.

So Lighthouse angka looks stricter, tetapi ini adalah measuring sebuah narrower slice. sebagai docs put ini, “server response time is only part of the full Time to First Byte (TTFB).” (terjemahan) “server respons time adalah hanya bagian dari full Time untuk pertama Byte (TTFB).” Don’t treat sebuah passing Lighthouse audit sebagai proof dari sebuah baik field TTFB, dan don’t panic itu 600 < 800 berarti thresholds contradict setiap lainnya — mereka mengukur berbeda things.

One versi note: sebagai dari Lighthouse 13, ini audit no longer stands alone — ini adalah telah folded ke broader “Document request latency” (terjemahan) “Document permintaan latency” insight. underlying ~600 ms server-respons periksa adalah yang sama; ini adalah hanya surfaced differently depending pada which Lighthouse versi generated Anda report.

Field dan lab — both

TTFB adalah one dari metrics Anda dapat read di both worlds. di field, ini comes dari CrUX (nyata Chrome pengguna), surfaced di PageSpeed Insights dan Search Console. di lab, Chrome DevTools labels ini “Waiting (TTFB)” (terjemahan) “Waiting (TTFB)” di Network panel waterfall (“the browser is waiting for the first byte of a response” (terjemahan) “ browser adalah waiting untuk pertama byte dari sebuah respons”), dan alat like WebPageTest dan Lighthouse report ini too. One field caveat: di CrUX, TTFB adalah masih treated sebagai somewhat experimental — ini excludes beberapa advanced navigation jenis like prerendered dan back/forward-cache navigations, so field averages dapat read sebuah touch pessimistic relative untuk what pengguna actually feel.

sebuah tinggi TTFB doesn’t selalu berarti sebuah slow situs

Here’s nuance itu threshold angka hide. sebuah server-rendered halaman dapat post sebuah higher TTFB daripada sebuah client-rendered one dan masih deliver better FCP dan LCP — because when itu pertama byte finally arrives, ini adalah complete HTML browser dapat paint immediately, alih-alih sebuah thin shell itu lalu memiliki untuk fetch dan run sebuah JavaScript bundle sebelum anything appears. Google says ini directly: “a server-rendered site that does not require as much client-side work could have a higher TTFB, but better FCP and LCP values than an entirely client-rendered experience.” (terjemahan) “sebuah server-rendered situs itu melakukan not memerlukan sebagai much client-side berfungsi dapat memiliki sebuah higher TTFB, tetapi better FCP dan LCP nilai daripada sebuah entirely client-rendered experience.”

flip side: untuk sebuah client-rendered single-halaman app, TTFB determines when JavaScript bundle bahkan starts memuat, so sebuah rendah TTFB penting more there, not less. Don’t mengoptimalkan TTFB di sebuah vacuum — mengoptimalkan whole memuat chain, dan judge TTFB oleh what ini melakukan untuk FCP dan LCP.

cara meningkatkan TTFB

Roughly di priority order:

  • Start dengan hosting. sebuah slow backend atau database kueri adalah sebuah tax pada setiap single permintaan, dan no amount dari front-end berfungsi menghapus ini. ini adalah pertama thing untuk pertimbangkan.
  • gunakan CDN. sebuah CDN solves proximity masalah — sebuah distributed network dari edge server caches resources physically closer untuk Anda pengguna, cutting speed-dari-light cost dari connection dan TLS handshake. ini adalah highest-ROI fix untuk sebagian besar situs, because geographic distance dari Anda origin adalah sebuah structural tax nothing pada backend dapat erase. caveat: untuk fully dynamic, personalized konten itu dapat’t menjadi cached, sebuah CDN menambahkan sebuah hop without sebuah cache-hit payoff — there jawaban adalah backend optimization, edge compute, atau streaming.
  • Cache Anda HTML, bahkan briefly. bahkan sebuah pendek cache time helps sebuah busy situs noticeably: hanya pertama pengunjung di itu window pays full latency back untuk origin; everyone else gets cached copy.
  • Eliminate redirects. Redirects adalah sebuah umum contributor untuk tinggi TTFB — setiap one adalah sebuah round trip sebelum nyata respons starts. Cut ones di bawah Anda control.
  • Stream markup untuk browser. browser process markup efficiently when ini adalah streamed di chunks sebagai ini arrives. banyak SSR frameworks mendukung streaming tetapi ini adalah left switched off; turning ini pada dapat drop TTFB pada dynamic halaman dengan no infrastructure perubahan di semua.
  • gunakan 103 Early Hints. 103 kode status adalah sebuah preliminary respons server dapat kirim while backend adalah masih preparing markup, hinting untuk browser untuk begin downloading render-critical resources early. ini doesn’t lower TTFB itself — di fact sebuah 103 dapat count sebagai “first byte” (terjemahan) “pertama byte” — tetapi ini shrinks impact dari sebuah tinggi TTFB. Shopify dan Cloudflare memiliki reported several hundred milliseconds dari LCP improvement dari ini, di beberapa cases close untuk sebuah kedua.
  • Negotiate TLS efficiently dan mengoptimalkan service worker startup. sebuah service worker itu hasn’t started yet menambahkan -nya startup time untuk TTFB; once running, -nya cache (stale-while-revalidate, atau sebuah app-shell model untuk SPAs) dapat dramatically reduce TTFB.

Where situs actually stand

alasan ini adalah worth Anda attention: ini adalah sebuah stubborn masalah di seluruh web. Web Almanac’s mobile baik-TTFB rate memiliki barely moved di five years — hovering sekitar 41–42% — meaning sebuah majority dari mobile situs masih don’t memiliki sebuah “good” (terjemahan) “baik” TTFB. itu stagnation adalah, frankly, sebuah opportunity. untuk sebuah server-heavy situs failing LCP, TTFB adalah biasanya highest-leverage fix pada board.

ini halaman adalah bagian dari web-performa cluster, which sits di bawah Core Web Vitals. untuk metrics TTFB feeds ke, see Largest Contentful Paint dan pertama Contentful Paint; untuk mengukur ini pada pengguna nyata dan di lab, see CrUX, PageSpeed Insights, dan Lighthouse.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.