Time to First Byte (TTFB) is the time between a browser asking for a page and receiving the first part of the response. It includes the network connection and the secure (HTTPS) handshake, but on most PHP websites the biggest part is the server running PHP and the database to build the page.
Nothing else can happen until that first byte arrives, so TTFB sets the starting point for everything visitors and search engines measure afterwards, including Largest Contentful Paint. You can read more about this in how your PHP version affects page speed and Core Web Vitals.
What is a good TTFB?
Google's guidance is that a TTFB of 0.8 seconds or less is good for most sites, measured for real visitors. In lab tests, PageSpeed Insights and Lighthouse flag "Reduce initial server response time" when the server takes longer than about 600 milliseconds to send the page. A well-cached page often responds in well under 200 milliseconds.
How to measure it
- PageSpeed Insights: enter your address at pagespeed.web.dev. If your site has enough traffic you'll see real visitor TTFB, and the lab test shows the server response time for that test.
- Your browser: open the developer tools (F12), go to the Network tab, reload the page and click the first request (the page itself). The Timing panel shows "Waiting for server response", which is the time spent building the page.
- The command line:
curl -o /dev/null -s -w "%{time_starttransfer}\n" https://www.example.com/ prints the TTFB in seconds. On Windows, use NUL instead of /dev/null.
Test several times and on several kinds of pages: the home page, a typical article, a search results page and, for shops, a product and the basket. The first request after a quiet period is often slower, and pages that can't be cached (logged-in pages, baskets) usually show the real cost of your PHP.
How to improve it
- Upgrade to a supported PHP version. Newer PHP releases run the same code faster, and it's often a simple setting in your hosting control panel. See changing your PHP version via a hosting control panel.
- Make sure OPcache is on. OPcache stores compiled PHP code in memory so it doesn't have to be re-read on every request. Your host or developer can check it in your PHP settings.
- Add page caching. A caching plugin, server cache or CDN can serve ready-built pages for visitors who aren't logged in, skipping PHP almost entirely.
- Use an object cache. Tools such as Redis or Memcached keep the results of common database queries in memory.
- Trim slow plugins and queries. A single plugin that runs a heavy database query on every page can add seconds. Remove what you don't use, and ask a developer to profile the rest.
- Look at your hosting. Overloaded shared servers, distant data centres and slow disks all add to TTFB. A CDN helps visitors far from your server.
Re-measure after each change, so you know which ones actually made a difference.
Start with the quickest win
Check your website's PHP version now. If it's behind, follow our PHP upgrade guide, or find a PHP developer to help with the rest.
Related articles
Up to date PHP is vital for the security and SEO of your website.
Read more →
Newer PHP versions build pages faster, cutting server response time and helping Core Web Vitals such as LCP.
Read more →
Hacked websites get spam pages, browser warnings and lost rankings.
Read more →
← Back to Web SEO & Security Articles
Article last updated: 21st October, 2026