Beamfar

How to measure and cut website TTFB under 800 ms (Cloudflare, Nginx, WordPress and Next.js)

Time to First Byte (TTFB) is the silent ceiling on every other speed metric your site publishes. No browser can start parsing HTML, downloading CSS, executing JavaScript, or painting your Largest Contentful Paint (LCP) hero image until the first byte of the HTML document arrives over the network. Google’s Core Web Vitals guidance places Good TTFB at 800 ms or less, Needs improvement between 801 ms and 1,800 ms, and Poor above 1,800 ms.

For agencies and e-commerce operators, high TTFB rarely announces itself with a hard outage. Pages still answer HTTP 200, uptime monitors stay green, and yet mobile checkout conversion quietly erodes because every anonymous visit waits 1.4 seconds for PHP, database queries, or an extra redirect hop.

The five components hidden inside one TTFB number

When a visitor opens your URL, TTFB is the sum of five distinct phases:

  1. Redirect hops: If http://example.com redirects to https://example.com, which then redirects to https://www.example.com/, the visitor pays two full network round trips before the final HTML request even starts. Collapsing canonical redirects into one 301 hop immediately saves 150–400 ms on mobile networks.
  2. DNS lookup: Slow or uncached authoritative DNS servers add 50–250 ms on cold visits. Anycast DNS providers (Cloudflare, Route 53, Bunny DNS, Hetzner DNS) typically resolve in 10–35 ms across Europe.
  3. TCP connect and TLS handshake: Distance between the visitor and your server drives round-trip latency (RTT). Enabling TLS 1.3 and HTTP/2 or HTTP/3 trims handshake round trips; placing a CDN edge close to visitors terminates TLS near the user instead of across an ocean.
  4. Origin processing time (server wait): The time between your web server receiving the HTTP request and flushing the first byte of HTML. On WordPress, WooCommerce, Laravel, or server-rendered Next.js apps, this phase routinely accounts for 70–90% of slow TTFB when pages miss cache and execute 40–150 database queries on every view.
  5. Upstream cache lookup: When a CDN or reverse proxy (Cloudflare, Varnish, Nginx FastCGI, LiteSpeed) serves a cached HTML copy directly from RAM, origin processing drops to 0 ms and total TTFB falls from 1,200 ms to 40–180 ms.

Check it now. The TTFB & server response time checker measures DNS lookup, TCP connect, TLS handshake, Time to First Byte (TTFB) against Google’s 800 ms Core Web Vitals threshold, HTTP cache/CDN headers and redirect hops with copy-paste speed fixes; the HTTP redirect chain checker traces every 301, 302, 307 and 308 redirect hop, catches redirect loops and HTTPS downgrades, checks TLS and builds copy-paste 1-hop 301 fixes. No account, and the address is not stored.

Reading cache-status headers to prove where time goes

Before touching application code or upgrading server RAM, inspect two groups of HTTP headers on your live page using our TTFB & server response time checker:

  • CF-Cache-Status / X-Cache / X-Vercel-Cache / X-LiteSpeed-Cache / X-FastCGI-Cache: Look for HIT versus MISS, BYPASS, or DYNAMIC. By default, Cloudflare treats HTML responses as DYNAMIC (bypassing edge cache completely) unless you explicitly configure a Cache Rule or APO.
  • Cache-Control and Age: A header like Cache-Control: no-store, no-cache, must-revalidate, max-age=0 on a public marketing or product page forces every CDN and proxy to bypass cache and forward every single visitor straight to your database origin.

Fast fixes by stack

Cloudflare Edge Cache Rules (public pages, bypass logged-in & cart)

Configure a Cache Rule that marks anonymous HTML eligible for edge caching while cleanly bypassing admin, login, and WooCommerce session cookies:

When incoming requests match:
  (not starts_with(http.request.uri.path, "/wp-admin")) and
  (not starts_with(http.request.uri.path, "/cart")) and
  (not starts_with(http.request.uri.path, "/checkout")) and
  (not http.cookie contains "wordpress_logged_in_") and
  (not http.cookie contains "woocommerce_items_in_cart")

Then:
  Cache eligibility: Eligible for cache
  Edge TTL: Override origin -> 1 hour

Nginx FastCGI micro-caching and compression

If you run WordPress, Laravel, or PHP-FPM on a Hetzner or DigitalOcean VPS behind Nginx, micro-caching anonymous GET responses for even 60–300 seconds protects the origin from bot floods and cuts p95 TTFB dramatically:

fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=PAGE:100m inactive=60m use_temp_path=off;
fastcgi_cache_key "$scheme$request_method$host$request_uri";

gzip on;
gzip_comp_level 5;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;
add_header X-FastCGI-Cache $upstream_cache_status always;

WordPress and WooCommerce origin hygiene

Even with edge caching, uncached visits (search queries, cart, checkout, logged-in users, cache warmups) still hit PHP. Keep origin wait below 400 ms by:

  • Enabling a persistent Redis object cache so wp_options autoloaded rows and WooCommerce queries stay in memory.
  • Auditing wp_options for bloated autoload = 'yes' rows over 1 MB left behind by deactivated plugins.
  • Replacing default wp-cron.php visitor-triggered pseudo-cron with a real system cron job monitored by a heartbeat check so background tasks never stall a customer’s page request.

Next.js and modern SSR frameworks

For marketing pages, product catalogs, and blog routes that do not change per user, avoid dynamic cookies() or headers() reads inside shared layout components (which silently opt the entire route out of static/ISR caching), and publish explicit Cache-Control: public, s-maxage=300, stale-while-revalidate=3600 headers so edge nodes serve stale HTML cleanly while refreshing in the background.

Why one-off tests miss production slowdowns

Running a single speed test after launch confirms your baseline, but real regressions appear weeks later: a plugin update clears cache rules, a marketing redirect adds an extra 302 hop, a cron batch locks a database table every night at 02:00 UTC, or a hosting neighbor saturates disk I/O.

Beamfar’s page speed monitoring records DNS, TCP, TLS, TTFB, and transfer times on every check from two European Union regions (Falkenstein (Germany) and Helsinki (Finland)), graphs p50 and p95 trends alongside Google Chrome UX Report Core Web Vitals, correlates sudden spikes with recent deploys or DNS edits, and alerts you when sustained slowdowns breach your target threshold.

Sources

Read on . Standards and vendor pages change; confirm the current text before you rely on it.

Terms used in this guide

  • Check intervalThe check interval is the time between two uptime checks. How it sets the detection delay, the number of checks and how it interacts with confirmation.
  • Uptime monitoringUptime monitoring requests a website from outside at intervals and alerts when it fails to answer. What it measures, what it misses and how it is confirmed.
  • Redirect chainA redirect chain is a sequence of redirects between the first URL and the final page. How many hops Google follows and why to collapse chains to a single hop.
  • SLAAn SLA is a written commitment on service levels such as availability and response time, how they are measured, what follows a miss, and the formulas behind it.

Try it on your own sites.

Add your sites: checking starts as soon as you do.

No card for the Free plan.