The most impactful fix for high server response time (TTFB) is activating full-page caching and moving your content to a server geographically closer to your visitors. With those two changes, most sites drop from a TTFB of 500–1000 ms to under 200 ms.
TTFB (Time to First Byte) measures how long the server takes to send the first byte of response after receiving an HTTP request. Google considers it a performance signal: a TTFB below 200 ms is "good," 200–500 ms "needs improvement," and above 500 ms is "poor" according to Core Web Vitals standards.
Here are the five most effective steps to reduce it, ranked by impact.
1. Enable Full-Page Caching
Without a cache, every visit runs PHP, queries the database, and builds HTML from scratch. With a page cache, the server stores the generated HTML and serves it directly—no database queries, no PHP interpreter.
The impact on TTFB is dramatic: from 300–800 ms without cache to 5–50 ms with disk or in-memory cache (Redis/Memcached).
Cache Options by Stack
- WordPress: WP Rocket, W3 Total Cache, or LiteSpeed Cache (if your host uses LiteSpeed). All offer full-page caching with minimal configuration.
- Custom PHP or framework: implement an output cache layer with
ob_start()and store HTML to files or Redis. - cPanel / Shared hosting: check if your plan includes object caching (Memcached or Redis)—many premium plans include it at no extra cost.
2. Use a CDN to Bring the Server Closer to Your Visitor
Physical latency is real. A server in Dallas takes ~120 ms in network latency alone to respond to someone in Mexico City, and over 200 ms for someone in Madrid. A CDN (Content Delivery Network) stores copies of your site at globally distributed nodes.
For sites with audiences in Mexico, Cloudflare has nodes in Mexico City, Querétaro, and Guadalajara. With Cloudflare's free plan, you can already reduce perceived TTFB for Mexican visitors to under 50 ms for cached content.
Explore more CDN and speed strategies in our web performance resource center.
3. Optimize Your Database and PHP Queries
When the cache can't serve a page—checkout pages, user dashboards—TTFB depends directly on how long PHP takes to build the response.
Common Causes of Slow PHP
- SQL queries without indexes on large tables.
- Plugins or modules firing dozens of queries per request.
- Non-persistent database connections (reconnecting on every request).
- Using
SELECT *when only 2–3 columns are needed.
Diagnostic Steps
- Enable the MySQL/MariaDB slow query log to identify queries taking more than 0.5 seconds.
- Use MySQL's
EXPLAINstatement to verify your queries use indexes. - In WordPress, install Query Monitor to see how many queries each page triggers.
| Cause | Symptom | Fix |
|---|---|---|
| Queries without indexes | High TTFB only on DB-heavy pages | Add indexes to WHERE/JOIN columns |
| Too many plugins | 50+ queries per WP page | Audit and deactivate unnecessary plugins |
| Old PHP (5.x, 7.0) | High TTFB site-wide | Upgrade to PHP 8.2+ |
| No OPcache | Consistently high TTFB | Enable OPcache in php.ini |
4. Enable PHP OPcache
OPcache is a PHP extension that stores compiled PHP bytecode in memory. Without OPcache, PHP compiles every file on every request. With OPcache, it skips compilation and executes directly from memory.
Recommended minimum configuration in php.ini:
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
The impact is immediate: 20–40% reduction in PHP execution time, which translates directly into lower TTFB for non-cached pages.
5. Reconsider Your Hosting if the Problem Is Infrastructure
If you've enabled caching, OPcache, and optimized queries, and TTFB is still above 400 ms on fully cached static pages, the bottleneck is the server itself. Low-cost shared hosting typically shares CPUs and disks with hundreds of neighbors.
Signs you need to upgrade your plan or provider:
- TTFB on fully cached pages consistently exceeds 200 ms.
- Response time varies widely throughout the day (a sign of shared overload).
- Your host doesn't offer PHP 8.x, OPcache, or Redis/Memcached object caching.
A VPS or managed hosting with LiteSpeed, Redis, and properly configured PHP-FPM can reduce base TTFB (without page cache) to 80–150 ms. With caching active, it drops below 30 ms. The team at elenlace.com can advise you on which plan fits your site's traffic and budget.
Key Takeaways
- The ideal TTFB is under 200 ms; above 500 ms hurts SEO and user experience.
- Full-page caching is the highest-impact change: it reduces TTFB up to 20× for cached pages.
- A CDN with nodes in your region (like Cloudflare) brings content closer to visitors and cuts physical latency.
- PHP OPcache eliminates repeated script compilation and improves execution times by 20–40%.
- Slow SQL queries are the top cause of high TTFB on dynamic pages—audit them with the slow query log.
- If TTFB on cached pages remains high, hosting is the bottleneck: consider a VPS or managed hosting plan.
Want a precise TTFB diagnosis and a personalized action plan? The team at elenlace.com conducts complete performance audits and guides you through every optimization step.
FAQ
What TTFB is acceptable for Google?
Google considers a TTFB below 200 ms "good," 200–500 ms "needs improvement," and above 500 ms "poor." However, Google doesn't use TTFB directly as a ranking factor—what it evaluates is LCP (Largest Contentful Paint), which partly depends on TTFB.
How do I measure my site's TTFB?
Use free tools like Google PageSpeed Insights, WebPageTest.org, or Chrome DevTools' Network tab (look for the "Waiting (TTFB)" field on the HTML request). For continuous monitoring, tools like UptimeRobot or Pingdom track historical TTFB over time.
Can page caching cause issues on sites with personalized content?
Yes, if not configured correctly. Pages that show different content per user (dashboard, cart, profile) should be excluded from full-page caching. Modern cache plugins let you define these exclusions by URL pattern or session cookie.
Is it worth paying for Cloudflare Pro just to improve TTFB?
For most sites, Cloudflare's free plan is enough to reduce perceived TTFB. Cloudflare Pro adds advanced cache rules, image optimization, and faster support—but the core TTFB improvement comes from the CDN itself, which is already included in the free plan.
Further reading
Other providers and guides worth comparing: