How I Reduced Server Response Time In WordPress To <100ms Globally (With Your Host + CDN Being The 2 Main TTFB Factors)

Reduce server response times ttfb wordpress

Hosting/CDN are the easiest ways to reduce server response times.

To measure your globally TTFB, use SpeedVitals or KeyCDN’s Performance Test. Most other testing tools like GTmetrix and PageSpeed Insights only measure TTFB in 1 single location.

Hosting is tricky because there’s so much bad information out there, but I’ve written several reviews explaining why most mainstream hosts don’t live up to the hype (SiteGround, Kinsta, WP Engine, Hostinger, and WPX aren’t good). Better options are cloud hosting on Rocket.net (what I use), Vultr High Frequency, and DigitalOcean. Make sure to check whether your hosting plan is shared vs. cloud, uses SATA SSDs vs. faster NVMe SSDs, and has enough cores/RAM. Test your site in WordPress Hosting Benchmarks and use a data center geographically close to users.

When users are far from your origin server, TTFB gets slower (shown here). CDNs help by mirroring files to their edge network, but they usually don’t cache dynamic content/HTML by default. This is what full page caching does (like Cloudflare APO or FlyingProxy). You could also use the Super Page Cache plugin, or if you’re on LiteSpeed, QUIC.cloud also does HTML caching.

The final touch lies in other CDN features like Cloudflare’s Argo and DNS which performs well on dnsperf.com (reducing latency), load balancing, and security features like WAF to block unwanted requests from hitting your server. The more unwanted requests you block (and the more files you cache), the less work the origin has to do. Cloudflare Enterprise is excellent for improving TTFB with  270+ locations, full paging caching, Argo, among other features. I’ll also show you why Rocket.net’s Cloudflare Enterprise is faster than Cloudways/Kinsta’s. Avoid WP Rocket’s RocketCDN and SiteGround’s CDN which don’t have many locations or speed features.

What Is A Good TTFB?

Google flags your TTFB if it’s over 600ms but they used to recommend just 200ms. You can aim for 600ms on shared hosting and 200ms on VPS/cloud. TTFB also depends on where you test it.

0-200ms Google Recommended
0-600ms Passes Core Web Vitals
600ms+ Fails Core Web Vitals

How To Test TTFB Globally

KeyCDN and speedvitals.com measure TTFB in multiple global locations while PageSpeed Insights and GTmetrix only measure TTFB in 1 location per test. Latency and TLS also impact TTFB which KeyCDN measures (for the record, TTFB affects LCP too). On a normal site without a CDN or HTML caching, TTFB gets slower when your site is tested far away from the origin server. With the right optimizations and edge network, you can have a fast TTFB anywhere in the world.

Keycdn-performance-test

 

1. Cache HTML

Most CDNs don’t cache HTML.

When caching HTML with Cloudflare’s APO, this improved TTFB by 72%. However, APO is just one way to do it. There are many  tools you can use depending on your hosting and CDN setup.

APO – serves HTML from Cloudflare’s edge network. The main difference between APO and a cache everything rule is the use of Workers KV storage and purging. It’s $5/mo and they have setup instructions. First make sure traffic is proxied through Cloudflare by using the orange cloud in the DNS settings. Once you purchase APO, you’ll create a token, install the Cloudflare plugin, enter your Cloudflare email + token, then activate APO. Visit uptrends.com, test your website using the www version, and make sure the headers match with the screenshot below.

Test cloudflare apo

Cloudflare apo ttfb impact
APO impact on TTFB (credit: Cloudflare)

Super Page Cache For Cloudflare Pluginplugin is similar to a cache everything page rule only it gives you more control by excluding pages from the cache, sessions for logged in users, ajax requests, etc. Here’s a thread from the plugin developer on how this is different than APO.

Super page cache for cloudflare plugin

FlyingProxy – Gijo’s product from WP Speed Matters. It caches HTML and also includes Cloudflare Enterprise features like priority routing, WAF, DDoS protection, image optimization, and other speed/security optimizations. It’s $10/month and can be used on any website/host.

Flyingproxy

QUIC.cloud HTML Caching – if you’re on a LiteSpeed server, use the LiteSpeed Cache plugin to setup QUIC.cloud CDN which has HTML caching. You should ideally use the paid (standard) plan since the free plan only uses 6 PoPs, while the standard plan uses all 70 PoPs + DDoS protection.

Quic. Cloud

SiteGround Optimizer’s Full Page Caching – SiteGround’s version of Cloudflare’s full page caching which can be setup using the SiteGround Optimizer plugin, although I don’t suggest using this plugin for much else beyond caching since it does a poor job addressing core web vitals and is unstable. Your website is also forced to use the WWW version in the domain name.

Siteground cloudflare www

 

2. Use A Host With Cloudflare Enterprise

“Minimizing TTFB is often done by choosing a suitable hosting provider with infrastructure to ensure high uptime and responsiveness. This—in combination with a CDN—can help.”

Google

3 popular hosts with Cloudflare Enterprise are Rocket.net, Cloudways, and Kinsta.

Rocket.net is the one you want. They’re the only host using Cloudflare Enterprise + full page caching which is also free. Cloudways/Kinsta don’t include full page caching and Ben Gabler (Rocket.net CEO) built the entire company and data centers around Cloudflare. You get 32 CPU cores + 128GB RAM + NVMe + Redis on all plans which is more resources than Kinsta and nearly any host. Because only about 10% of traffic actually hits your origin, they don’t need to limit PHP workers while allowing up to 25x monthly visits than Kinsta. This is why their customers average a <100ms global TTFB. Also a top performer in Kevin Ohashi’s WP Hosting Benchmarks.

With Cloudflare Enterprise, you get features that improve both TTFB and security: prioritized routing, WAF, Argo + tiered cache, load balancing, Mirage/Polish, as well as full page caching.

Rocket. Net cloudflare enterprise

Kinsta Rocket.net
CPU Cores 12 Cores 32 Cores
RAM 8GB 128GB
Staging CPU Cores 1 Core 32 Cores
Staging RAM 8GB 128GB
PHP Worker Limits Yes No
Monthly Visits ($30-$35/mo plan) 25,000 250,000
Redis $100/mo Free
Storage Network SSDs NVMe
TrustPilot Rating 4.3/5 4.9/5
Rocket. Net cloudflare enterprise vs apo
Ben Gabler explains Cloudflare Enterprise vs. APO
Kinsta to rocket. Net ttfb redis
You can also search their TrustPilot reviews for “TTFB” to find testimonials

LiteSpeed is also a solid choice. It’s faster than Apache/NGINX and handles more requests with less chance of CPU spikes. Plus, you get LiteSpeed Cache + QUIC.cloud. Here’s a list of LiteSpeed hosts I recommend with NameHero, ChemiCloud, RunCloud, and GridPane being four top picks. LiteSpeed’s server-level caching and QUIC’s HTML caching are great features for reducing TTFB.

Litespeed vs nginx vs apache

 

3. Choose A Plan With Enough Memory (RAM)

Some hosts don’t list how many CPU cores + RAM you get which is usually a red flag.

Here are 4 hosts that do. For example, when you compare NameHero’s specs with Hostinger’s specs, NameHero gives you more CPU/RAM than Hostinger, which is why Hostinger is cheaper.

Namehero plans resources
Check specs before choosing a hosting plan

Ram on litespeed hosting plans

When you compare Rocket.net to Kinsta, Rocket.net gives you 32 cores + 128GB RAM while Kinsta only gives you 12 cores + 8GB RAM. Both these are listed in each host’s inner pages/blog.

 

4. Choose A Plan With NVMe Storage

NVMe performs better than SSD hard drives, especially when it comes to disk I/O.

Here’s a test by Rocket.net using the WordPress Hosting Benchmark Tool plugin which was done after Kevin Ohashi’s WP Hosting Benchmarks to see if they could improve in 2022’s test.

Rocket.net isn’t the only WordPress host using NVMe. So does Vultr High Frequency, NameHero’s Turbo Cloud plan, A2 Hosting’s Turbo Boost plan, and several others. Check their specs page! SiteGround, Kinsta, Hostinger, and many other mainstream hosts don’t use NVMe.

Rocket. Net ssds
SSD Hard Drives
Rocket. Net nvme
NVMe

 

5. Select A Data Center Close To Your Visitors

If visitors are from a specific location, choosing a close data center is still important.

Let’s say 90% of traffic is served from Cloudflare, but 10% is hitting your origin because certain files aren’t cached or you’re getting cache misses. You still want a close data center for that 10%.

Keycdn performance test cloudflare 1
TTFB gets slower as geographic distance increases (especially if you’re not caching HTML)

 

6. Use Cloudflare Argo For Better Traffic Routing

Argo improves TTFB by avoiding traffic congestion and delivering content from faster, more reliable network paths. It also has tiered caching + TCP optimizations, but only makes sense if visitors aren’t local. It’s a paid service and worth testing if you have slow server response times.

Cloudflare argo

If you use Argo, be sure to request beta access to cache reserve.

Cloudflare cache reserve

 

7. Use Load Balancing To Route Traffic From Unhealthy Origins

Load balancing steers traffic away from unhealthy origins and distributes traffic to the most available server pools (improving latency which is part of TTFB, as well as uptimes). However, this can get expensive and you’ll probably just want to use Cloudflare Enterprise somewhere else which usually includes load balancing. Cloudflare has a video on setting it up in Cloudflare.

Cloudflare load balancing

 

8. Reduce Latency With A Fast DNS

TTFB includes latency, so your DNS matters too.

Check dnsperf.com to see the fastest, most reliable DNS providers. Cloudflare is consistently one of the top performers and is free. GoDaddy’s doesn’t perform well, Amazon Route 53 is alright (used by Kinsta), and even Google Cloud isn’t the fastest. SiteGround’s DNS was also blocked by Googlebot for 4 days, so I wouldn’t use their DNS either. Try to stick with Cloudflare.

Cloudflare dns

How To Move Your DNS To Cloudflare

Sign up for Cloudflare through their website, add your website, and they will scan records. Cloudflare will eventually provide you with 2 nameservers. Login to your domain registrar (i.e GoDaddy/Namecheap) and find the option to change nameservers (usually in the DNS settings). Replace the nameservers with Cloudflare’s, then in Cloudflare, click ‘Done, check nameservers.’

Cloudflare change namesevers

 

9. Reduce Server Load

I recommend skimming through my tutorial on reducing CPU usage since eliminating unnecessary requests reduces the load on your server, whether it’s on the frontend or backend.

A lot of this is disabling/blocking things you don’t need: aggressive bots, XML-RPC, plugin modules, etc. Some things can be limited too (changing how preloading/purging works in your cache plugin is a big one, limiting the WordPress Heartbeat API, autosaves, post revisions, etc).

Quick Tips To Reduce CPU Usage:

  • Control preloading in cache plugins
  • Control cache clearing in cache plugins
  • Replace wp-cron with a real cron job
  • Limit heartbeat, autosaves, post revisions
  • Remove plugins causing high CPU usage
  • Disable unused features in module-based plugins
  • Protect the wp-login page and limit login attempts
  • Avoid plugins that run scans or add database bloat
  • Block AhrefsBot + SemrushBot if you don’t use them
  • Don’t cache logged-in users if you don’t need to
  • Decrease the batch size when removing unused CSS
  • Don’t create a separate mobile cache if you don’t need to
  • Check if certain cache plugin settings increase CPU usage
  • Use a firewall to block unwanted requests to your server (important!)
  • Enable hotlink protection to prevent websites from stealing bandwidth
  • Use Cloudflare bot fight mode, crawler hints, rate limiting, firewall rules

Reduce cpu usage wordpress

 

10. Use PHP 8.0

Higher PHP versions handle more requests/second.

Login to your hosting account and update to the latest stable PHP version. It’s a good idea to keep other technologies updated as well (MySQL version, WordPress core, themes, plugins, etc).

Php 8. 0

 

11. Enable OPcache

OPcache reduces CPU usage by optimizing scripts and stores compiled PHP scripts in memory. It can be enabled in cPanel’s PHP Extensions, Cloudways has a guide, or Google it for your host.

Opcache

 

12. Enable Object Cache

Object cache stores database query results so they can be accessed quickly which can reduce loads and server response times.

I generally recommend Redis over memcached which is known for having more efficient memory usage. Cache plugins like LiteSpeed Cache, W3 Total Cache, and SG Optimizer have object cache settings where you can set it to Redis or memcached. You also need to enable it in your hosting account (i.e. cPanel PHP Extensions or SiteGround Site Tools). Enabling the Redis add-on in Cloudways installs Object Cache Pro as a drop-in plugin. Some hosts like Rocket.net require a specific Redis plugin so make sure to go through their documentation or ask support.

Redis memcached cpanel
Enable Redis or memcached in your hosting account (screenshot is for cPanel)
Litespeed cache object cache
Activate Redis in your cache plugin if it supports it

 

13. Test With And Without Gzip/Brotli

Compressing pages with Gzip or Brotli can sometimes increase TTFB, so make sure you test this. Check if your host supports Gzip/Brotli compression (Brotli is generally faster than Gzip).

Brotli cpanel

Cloudflare brotli
Cloudflare also has an option to enable Brotli

 

14. Enable HTTP/3

Cloudflare’s test showed TTFB was 12.4% faster when using HTTP/3.

If you’re on LiteSpeed, you can enable HTTP/3 using QUIC.cloud in LiteSpeed Cache. As Ryan from NameHero explains, Cloudflare’s HTTP/3 setting pulls from HTTP/2 and delivers from HTTP/3 (which is not full HTTP/3 support). For best results, follow his video to enable HTTP/3.

Http 3 check
Use an HTTP/3 test to check if your website supports it

 

15. Reduce TLS/SSL Latency

These settings are found in Cloudflare’s SSL/TLS settings. Optimizing these can reduce latency and TTFB (TLS can be measured in KeyCDN).

  • Full (Or Full Strict) SSL – this is what Cloudflare recommends anyway.
  • Always Use HTTPS – safe to use if all connections are served from HTTPS.
  • TCP Turbo (Pro Feature) – reduces latency by automatically choosing TCP settings.
  • Minimum TLS Version – set to 1.2 (same with TLS settings in your hosting account).
  • Custom SSL (Pro Feature) – upload SSL to Cloudflare to terminate SSL/TLS at the edge.
Tls checker
Use a TLS checker to see which versions your website supports
Cloudways tls versions
Use TLS 1.2 + 1.3 as preferred versions in your hosting account

 

16. Invest In A Better Cache Plugin

Cache plugins reduce TTFB by improving server processing times and serving files directly (reducing PHP/MySQL queries). 4 key things to consider when choosing a cache plugin are:

  • How well it addresses core web vitals.
  • The actual caching and how fast it is (server-side vs. file-based).
  • Whether it optimizes mostly for scores or real-world browsing as well.
  • Whether you’re forced to use a specific CDN and how good that CDN is.

I recommend FlyingPress (what I use) or LiteSpeed Cache over most cache plugins.

SG Optimizer WP Rocket FlyingPress
Server-side caching x x
Delay JavaScript x
Remove unused CSS x Inline Separate file
Critical CSS x
Preload critical images x x By number
Exclude above the fold images By class By URL By number
Lazy load background images x Inline Helper class
Fetchpriority resource hint x x
Lazy render HTML elements x x
Add missing image dimensions x
YouTube iframe preview image x
Self-host YouTube placeholder x x
Host fonts locally x x
Font-display: swap x
Preload links x
CDN (beyond Cloudflare) SiteGround CDN StackPath BunnyCDN
CDN PoPs 176 60 114
CDN Tbps N/A 65 80
Dynamic caching x x
CDN geo-replication x x
CDN image optimization x
CDN image resizing for mobile x x
Documented APO compatibility x x

FlyingPress – excellent job addressing both core web vitals and real-world browsing, settings are easy to configure, and it can be used with any host. FlyingCDN is powered by BunnyCDN which is a solid CDN choice especially since it includes Bunny Optimizer’s image optimization as well as geo-replication. The cons are that it costs money and doesn’t have server-side caching.

Omm switches to flyingpress

LiteSpeed Cache – faster server-side caching and also does an excellent job addressing core web vitals and real-world browsing. It’s free, has great ratings on WordPress, and QUIC.cloud is a solid CDN with HTML caching, image optimization, and security features. Main cons are you have to use a LiteSpeed host and there are a lot of settings which can be difficult to configure.

WP Rocket – doesn’t address core web vitals as much as FlyingPress or LSC. Also doesn’t do a great job optimizing for real-world browsing. RocketCDN (StackPath) performs poorly and was removed from cdnperf.com. Settings are easy(ish) but also costs about the same as FlyingPress.

SiteGround Optimizer – only use it for caching, not for core web vitals. It also has a history of compatibility issues where Hristo constantly blames third-party themes/plugins. I’d only use it for dynamic caching and memcached (and maybe Cloudflare’s full page caching), then disable everything else and use a different plugin. It’s free and the settings are easy, but bad otherwise.

Free Cache Plugins – most free cache plugins do a poor job addressing core web vitals. W3 Total Cache and Swift Performance are alright, but I suggest leaning towards something else.

NitroPack – cheats PageSpeed scores by moving things off the main-thread which gives you false scores in speed testing tools. Doesn’t actually improve real-world browsing or page load times as much as other cache plugins. Never recommended NitroPack and probably never will.

 

17. Limit Preloading And Disable Automatic Cache Clearing

Preloading can cause high CPU usage and stress out your server. It’s used in WP Rocket, LiteSpeed Cache’s crawler, SiteGround Optimizer’s preheat cache, and other cache plugins.

The problem is that by default, your entire website is preloaded using your sitemap. Another problem is the entire cache is cleared when specific actions are taken (something as simple as updating a widget). And finally, the preload interval may be too high for your server to handle. A few easy tweaks can significantly reduce the amount of server resources preloading consumes.

  • Only preload important sitemap URLs (i.e. pages/posts), not the entire sitemap.
  • Increase the interval pages are preloaded (WP Rocket has a helper plugin for this).
  • Disable automatic cache clearing (WP Rocket has another helper plugin). Any time you do a specific action, the entire cache is cleared (here are the actions for WP Rocket). This can cause a lot of stress on the server especially if you’re working on your website outside of writing content. A better alternative is to disable automatic cache clearing and use a cron job to control what happens when the cache is cleared and when (i.e. middle of the night).

The last thing you want is to constantly trigger actions that clear your entire cache.

Wp rocket sitemap preloading
View your sitemap (usually https://example.com/sitemap_index.xml) and only preload important URLs

 

18. Increase TTL

A longer TTL (time to live) is better for performance since the cache doesn’t have to rebuild as frequently. It also leads to a better cache hit ratio. As I mentioned before, the more cache hits you can get, the faster your TTFB will be. Google recommends caching static resources for an entire year which fixes serve static assets with an efficient cache policy in PageSpeed Insights. This is usually done in your hosting account or CDN, depending on where your cache is stored.

Nginx static cache expiry
Longer cache lifespans are better for performance

 

19. Clean Your Database Thoroughly

Do a thorough database cleanup with WP-Optimize.

This lets you go through your plugin tables, view how much overhead they add, and remove tables left behind by old plugins. And who knows, maybe you’ll see specific plugins/modules add lots of database bloat. I did, so disabled several features in Rank Math like their Analytics.

Wp optimize unused database tables

 

20. Identify Slow Plugins, Queries, Bottlenecks

Here’s how:

  • View my full list of 75+ slow plugins.
  • Find slow plugins/queries in Query Monitor.
  • Use WP Hive to see plugins that impact memory usage.
  • Find heavy usage files in Chrome Dev Tools coverage report.
  • Check your GTmetrix Waterfall for long tasks and red errors.
Slow wordpress plugins query monitor
Query Monitor
Unused css chrome dev tools
Chrome Dev Tools coverage report
Wp hive high memory usage plugins
WP Hive
Gtmetrix waterfall bottleneck
GTmetrix Waterfall chart

 

21. Avoid Shared Hosting

SiteGround: they’ve lied about their slow TTFB for years and go as far to censor people by banning people in Facebook Groups and legally threatening people who speak out about them. Just check Backlinko’s TTFB test or search the WP Speed Matters Facebook Group to get real opinions (since many Facebook Groups are moderated by SiteGround and their “brand ambassadors”). Plus, they’re CPU limits are awful and often unfixable.

Siteground slow ttfb

Siteground slow ttfb left

Siteground cpu limits joke

Hostinger: only cheap because they give you less CPU cores, RAM, and other resources than similar hosts. But if you compare their specs vs. price, they’re actually one of the worst values. They also built their company on fake reviews and scamming people. No!

Average cost per cpu core 1gb ram hostinger vs a2 hosting vs namehero vs chemicloud

Hostinger poll

Hostinger bad

WPX: not the fastest WordPress host and a complete marketing gimmick (Matthew is obviously an affiliate yet he claims his tests are independent). Their TOS doesn’t set limits to server resources, inodes, or email… which means it’s at their discretion whether you’re using it too much. Response to 3-day outage by their CEO was also a disaster since they didn’t have a redundancy system and blamed this on a dead CEO.

GoDaddy: overcrowded servers and I/O issues. Many people use GoDaddy because they’ve heard of them (from advertising) but more people are joining FB groups and learning how bad they are. Their managed WordPress hosting plans are also a big no.

Godaddy wordpress hosting review

Bluehost: mainly promoted by affiliates but one of the least recommended hosts in Facebook Groups. Recommended by WordPress only because they pay them (a lot). Owned by EIG who also owns HostGator with low storage, inode limits, CPU throttling.

Bluehost hosting review

What is a good server response time?

Google flags your server response time if it's over 600ms, but they previously recommended 200ms which is realistic on cloud/VPS hosting.

How do I reduce server response times in WordPress?

Hosting and CDNs are by far the top 2 factors that impact TTFB.

How do I improve TTFB on WooCommerce?

Remove unnecessary WooCommerce bloat such as scripts, styles, meta box, and marketplace suggestions. Most can be disabled using the Disable WooCommerce Bloat plugin. Avoid running WooCommerce on shared hosting and using heavy page builders.

Which WordPress plugin reduce TTFB?

LiteSpeed Cache and Cloudflare's plugin with their APO are the top 2 WordPress plugins that can reduce TTFB.

How do you measure server response times?

KeyCDN is a great way to measure server response times (TTFB) in 10 global locations.

Cheers,
Tom

You Might Also Like:

28 Comments...

  1. Hey Tom, please add a search function back on to your site. I am trying to find if you have any recommendations on MariaDB settings as I am still on 10.4 but without search I can’t find anything. Thanks so much
    PS – you are my go-to person for anything hosting/caching/speed related – thanks for all your awesome work :)

    Reply
    • I will definitely add a search bar in my next round of updates. I don’t think I’ve posted anything on MariaDB settings! Where are you seeing these can I ask?

      Thanks so much for reading Anna! Sorry I can’t help… and for my late response :-/ always trying to play catch up in this industry.

      Reply
  2. I’ve got issue when I use APO from cloudflare, it’s showing error “cf-edge-cache response header is missing! Please clear any server cache used via other plugins”

    Can you tell me how do I fix this issue?

    Reply
    • Not sure which cache plugin/host you’re using but both should have an option to purge cache in their settings. If you’re using built-in server caching from your host like Varnish, you should see an option.

      Reply
  3. i Have amazon’s best hosting possible. ANd using nitro pack and still cant get rid of initial server error response. I am using DIVI theme and have optimized images and everything possible. I am still getting FCP Errors on Google.
    what am I missing here?

    Reply
    • Hi Mahnoor,

      I looked through your site/report. My 3 recommendations are to get rid of Nitropack, remove the preconnects to GTM and other third-party sites which aren’t being used, and optimize fonts (you have 20 fonts all being served from fonts.gstatic.com… you should be able to reduce these and host them locally).

      I’m not sure about the Amazon hosting, but I would definitely stop using Nitropack. It cheats scores by moving things off the main-thread. Google “Nitrohat blackhat” and you will find a lot of results to read about. I personally just switched from WP Rocket to FlyingPress but both are better than Nitropack. You might see great scores because it does this, but when you actually browse through your site and check load times, it’s usually not good.

      Those 3 things should solve most speed issues.

      Reply
  4. Thank you for the great information. Server issue cannot be fixed completely (for me), but I agree hosting effects a lot. I am too getting server response time of 0.65sec and I think this is due to the hosting provider.

    Reply
  5. This is the most helpful and honest article about improving page speed.My page pageSpeed score increased from 56 to 90%.

    Reply
  6. Thank you for the great information. Server issue cannot be fixed completely (for me), but I agree hosting effects a lot. I am too getting server response time of 0.65sec and I think this is due to the hosting provider.

    Reply

Leave a Comment