How to reduce TTFB with a CDN and better DNS

Time to first byte is DNS plus TLS plus origin or cache. How Cloud CDN hits, HTTP/3 and Anycast DNS cut TTFB for global visitors.

TTFB is the wait before the first byte of the response. People blame PHP, then ship a bigger origin. For global visitors the wait is often geography: a lookup in one continent and an origin in another.

Split the number

TTFB includes DNS lookup, connection, TLS and then server think time. A CDN hit makes server think time approximately zero for that object. HTTP/3 and TLS 1.3 with 0-RTT shrink the handshake.

If TTFB is only bad far from the origin, you do not have an application problem first. You have a distance problem.

Cache the document, not only the assets

Optimising images while HTML still comes from origin leaves the most important TTFB untouched. Anonymous pages should be cacheable at Cloud CDN with purge on publish.

Hashed assets already have excellent TTFB once cached. HTML is where most sites still fail.

DNS is on the critical path

A slow or far-away authoritative answer adds to the same user-visible wait. Anycast Cloud DNS on 210+ servers keeps the lookup close to the resolver.

A 300-second TTL on a record you just moved also looks like TTFB to the users still hitting the old origin.

Misses still matter

Origin Shield and keep-alive to origin stop miss storms from becoming TTFB storms. Serve-stale covers origin blips for eligible content.

Measure hit ratio by path. A 40% hit ratio on HTML means TTFB still tracks origin for most page views.

Frequently Asked Questions

It will still help assets, TLS and DNS. The HTML itself should bypass cache, so document TTFB stays origin-bound for those routes.

No, but Cloud CDN offers HTTP/3 and HTTP/2. Clients that can use QUIC spend less time in handshakes, especially on lossy mobile networks.

Look at DNS timing in a waterfall from more than one region. If lookup dominates, move authority to Anycast before you scale origin CPUs.

Talk through CDN and DNS with Aptranet.

Get started with our Management Console in less than 2 minutes, or connect with an expert to supercharge your business today.