Time to first byte (TTFB) is how long the server takes before it starts sending a page. For a Magento page served from cache it should be well under a second. When it’s slower, visitors stare at a blank screen, and it counts against you in search rankings.

Measure it

curl -o /dev/null -s -w 'ttfb: %{time_starttransfer}s\n' https://your-store.com/

Run it several times and on several page types: home, category and product.

Is the page cached?

curl -sI https://your-store.com/ | grep -i -E 'x-magento-cache|age|x-cache'
  • Cached but slow: the server itself is overloaded. Check CPU, memory and PHP-FPM workers (see PHP-FPM saturation).
  • Not cached: the page is built from scratch on every visit. That’s the most common cause and the biggest win (see full page cache not working).

If uncached pages are slow

  • Check that OPcache is enabled and big enough (see OPcache settings).
  • Look for slow database queries (see slow query log).
  • Look for extensions calling external services during page load, for example currency rates or stock checks.
  • Use a profiler such as Blackfire or New Relic on a staging copy to see where the time goes.

Catch it automatically

MageMonitor checks for this every few minutes as part of its performance checks, and alerts you by email, Slack or webhook the moment it appears, with the exact commands to fix it. See MageMonitor for Magento 2.

Related fixes