Slow TTFB when using https on WordPress, though optimized many times

724 views Asked by At

I got trouble with the TTFB on my WordPress. It's always very slow on the first time loading on the browser and after many reload, TTFB still more than 600ms. This is some information:

  • My website: https://passioshop.com/
  • Using Contabo.com VPS: 6 vCPU Cores, 16 GB RAM, 400 GB SSD
  • Using Cloudflare:
    • Cache level: Standard
    • Cache TTL: Max time
    • Activate: auto minify, Brotli, Always Online, HTTP/3 (with QUIC), 0-RTT...
    • Not using Rocket Loader
  • Optimize Wordpress:
    • Using WP-Optimize: Compress images, page caching, not using Minify and Combined because I want to render page as fast as possible.
    • Using Asset CleanUp: Disable all unused script and CSS especially WooCommerce, Elementor. Disable Emojis, oEmbed, Dashicons, Gutenberg, XML-RPC...
  • Optimize WHM: https://www.pakistanwebserver.com/hosting-tutorial/optimize-wordpress-better-performance-cpanel-hosting/
  • Update and optimize mySQL: using MariaDB, 256MB Query Caching...

But the result only affected in TTLB not TTFB:

  • Using this command: curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://passioshop.com . I noticed that, The TTFB:
    • When using HTTP: 0.016s
    • At first time, using HTTPS: 2.799s
    • The next time, using HTTPS: 0.209s
  • In the Inspect of browser:

This is the first time loading on the browser: This is the first time loading on the browser

And the next time, especially load plain text like https://passioshop.com/test.html, it's still above 500ms:

And the next time

I nearly got 100 point in Google PageSpeed Insights: enter image description here

Someone please help me to solve this. Any tips or how to find the reason may help me a lot! Thanks for any help.

1

There are 1 answers

2
Maksim I. Kuzmin On BEST ANSWER

The fact that static files are rendered within the same ~500ms implies that the problem is not with WordPress at all. I'd suggest try to do the following things:

  1. Disable Cloudflare protection at all for some time, and see if it improves the result.
  2. Since you have VPS, I may assume you have root access, so you could try to install Nginx + Apahce2 setup, so the static files are guaranteed to be rendered faster than.

Things that won't affect the speed in your case:

  • Optimize Wordpress
  • Update and optimize mySQL: using MariaDB, 256MB Query Caching...