Guides · Performance

Time to first byte (TTFB)

One of the checks in every audibot report. This page says exactly what audibot reads, what passes, and how to fix it.

What audibot checks

The time from audibot sending the request for the home page — the final URL, after redirects — to the first byte of the response, including DNS, connection and TLS setup. It is one measurement from audibot's server, not an average of visitors.

Why it matters

Nothing on the page can start until the first byte arrives, so a slow server delays everything after it, on every visit.

How do I reduce time to first byte?

A slow first byte is usually work done on every request: an uncached database query, a server that has to cold-start, or an origin far from visitors. Cache the rendered page on the server or at a CDN edge, and serve static pages as files.

Measure it yourself

curl -so /dev/null -w 'dns %{time_namelookup}s  connect %{time_connect}s  tls %{time_appconnect}s  ttfb %{time_starttransfer}s\n' https://example.com/

nginx: micro-cache an upstream for a few seconds

proxy_cache_path /var/cache/nginx keys_zone=pages:10m;

location / {
    proxy_cache pages;
    proxy_cache_valid 200 10s;
    proxy_cache_use_stale updating error timeout;
    proxy_pass http://app;
}

Related tools

Other checks in Performance

Performance in the methodology ·All guides

This check is one step of the website launch checklist.

Check your site

audibot runs this check and every other one in a single audit, and publishes the report with a recommendation for each finding.