You can have the fastest JavaScript, perfectly compressed images, and a blazing CDN — but if your server takes 2 seconds to respond, your page will still feel slow. TTFB is the foundation of every other performance metric. Fix it first.

What is TTFB?

Time to First Byte (TTFB) measures the time from when a browser sends an HTTP request to when it receives the first byte of the server's response. It includes:

Of these, server processing time is almost always the biggest contributor on WordPress sites — and the most fixable.

What's a good TTFB for WordPress?

Google's PageSpeed Insights (and WPStats) flags TTFB over 600ms as a "Reduce server response time" issue. For context, a well-cached WordPress site on good hosting typically achieves 80–150ms.

Step 1: Diagnose your TTFB

Before fixing anything, measure your baseline:

Test from multiple locations. TTFB varies significantly by geographic distance from your server. Use WebPageTest with multiple test locations to understand your global TTFB profile.

Step 2: Enable full-page caching (biggest impact)

An uncached WordPress page requires PHP to execute, run 30–100+ database queries, and render HTML — all before sending a single byte. A cached page is served as a static HTML file: response time drops from 500ms–2s to under 50ms.

This is the single most impactful TTFB improvement for most WordPress sites.

Best caching plugins by hosting type:

Step 3: Add object caching with Redis or Memcached

Even with page caching enabled, dynamic pages (WooCommerce cart, logged-in users, search results) can't be fully page-cached. Object caching stores the results of expensive database queries in RAM, dramatically reducing query time for these requests.

Setting up Redis on WordPress:

# On Ubuntu/Debian server
sudo apt install redis-server php-redis

# Then install the WordPress plugin:
# "Redis Object Cache" by Till Krüss

After installing the plugin, go to Settings → Redis and click "Enable Object Cache." You should see a green "Connected" status. Database-heavy pages can see 40–70% TTFB reduction with Redis.

Step 4: Optimize your PHP configuration

Use PHP-FPM with OPcache

PHP OPcache stores compiled PHP bytecode in memory, eliminating the need to recompile PHP files on every request. It's included with PHP 5.5+ but may not be enabled by default.

Check if OPcache is enabled: add <?php phpinfo(); ?> to a test file and look for the OPcache section. Recommended settings in php.ini:

opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.fast_shutdown=1

Upgrade to PHP 8.2+

PHP 8.x is significantly faster than PHP 7.x for WordPress. Switching from PHP 7.4 to PHP 8.2 typically yields 15–30% faster execution time. Check your PHP version in WordPress Admin → Tools → Site Health.

Step 5: Optimize your database

Slow database queries are a major cause of high TTFB on older or larger WordPress sites. Every uncached page load runs dozens of queries; slow ones block the entire response.

Find slow queries:

Install the Query Monitor plugin. It shows every database query per page, sorted by execution time. Anything over 100ms deserves investigation.

Quick database fixes:

Step 6: Upgrade your hosting

If you've enabled caching and still see TTFB over 300ms, your hosting infrastructure may be the bottleneck. Signs that you need better hosting:

Hosting tiers for TTFB:

Hosting typeTypical cached TTFBCost
Budget shared hosting300–800ms$3–8/mo
Quality shared hosting (SiteGround)100–300ms$15–30/mo
Cloud VPS (Cloudways/DigitalOcean)50–150ms$15–50/mo
Managed WordPress (Kinsta/WP Engine)30–100ms$30–100/mo

Step 7: Use Cloudflare for DNS + edge caching

Cloudflare's free tier provides:

On Cloudflare's paid plans, you can also cache full HTML pages at the edge with Page Rules or Cache Rules, bypassing your origin server entirely.

Measuring your improvement

After implementing these changes, measure TTFB again from multiple locations. Use WPStats to get a quick read, and WebPageTest for detailed before/after waterfall comparisons. Target:

Pro tip: Check TTFB separately for cached and uncached pages. Browse to a post while logged out (cached) vs logged in (uncached/dynamic). The gap tells you how effective your caching is.

Check your WordPress TTFB right now

WPStats measures your server response time and PageSpeed scores instantly — free, no registration needed.

Measure my TTFB