Cos'è TTFB (Time to First Byte)?
Definizione Rapida
Il TTFB misura il tempo tra la richiesta di una pagina da parte del browser e la ricezione del primo byte di dati dal server, fungendo da indicatore del tempo di risposta.
Time to First Byte (TTFB) is a performance metric that measures the duration between a user's browser sending a request and receiving the very first byte of the server's response. It captures three phases: the time to send the request, the time the server takes to process it, and the time for the first byte to travel back.
A good TTFB is under 200 milliseconds. Between 200-500ms is acceptable, and anything over 600ms indicates a performance problem. Google considers TTFB when evaluating page experience, though it's not one of the Core Web Vitals.
Several factors affect TTFB. Server processing time depends on how long it takes to run database queries, execute server-side code, and generate the response. Network latency is the physical travel time between the user and server (which a CDN can reduce). DNS resolution time is how long it takes to convert your domain name to an IP address.
Common causes of slow TTFB include overloaded or underpowered servers, unoptimized database queries, lack of server-side caching, slow third-party API calls during page generation, and no CDN (meaning all requests go to a single origin server). Each of these can be diagnosed and improved with targeted optimizations.
Perché è Importante
TTFB is the starting gun for your page load. Nothing else can happen until the browser receives that first byte. A slow TTFB delays everything: the HTML document, the CSS, the JavaScript, the images. It's the foundation that all other performance metrics build on.
For businesses, TTFB directly impacts user experience and conversion rates. If your server takes 2 seconds to respond before the browser can even start rendering the page, users on slower connections might wait 5+ seconds for a usable page.
Esempi Pratici
A WordPress site with a TTFB of 1.8 seconds implemented server-side caching and reduced it to 150ms, cutting total page load time by more than half
An e-commerce platform discovered their TTFB was 900ms due to slow database queries; adding database indexes and query caching brought it down to 120ms
A media site moved their origin server from a single US location to a CDN with edge caching, reducing TTFB for European users from 800ms to 80ms
A SaaS dashboard reduced their TTFB from 1.2 seconds to 200ms by pre-computing frequently accessed data and caching the results
Termini Correlati
Core Web Vitals
Le Core Web Vitals sono tre metriche specifiche definite da Google che misurano la reale esperienza degli utenti sui siti: prestazioni di caricamento (LCP), interattività (INP) e stabilità visiva (CLS).
CDN (Content Delivery Network)
Un CDN è una rete di server distribuiti geograficamente che consegna i contenuti web agli utenti dal server più vicino a loro, riducendo i tempi di caricamento.
Caching
Il caching è il processo di archiviazione di copie di dati o file in una posizione temporanea in modo che le richieste future possano essere soddisfatte più rapidamente.
LCP (Largest Contentful Paint)
LCP misura il tempo necessario perché il più grande elemento di contenuto visibile su una pagina — come un'immagine hero o un titolo — venga renderizzato completamente.
Hai bisogno di aiuto con ttfb (time to first byte)?
Il nostro team può aiutarti a mettere in pratica questo concetto. Ottieni una consulenza gratuita per discutere del tuo progetto.