This post summarized my recent attempt to improve the performance of my website. This post will be updated from time to time.
Recently, I got a Black Friday deal at my previous server provider. I chose their new plan and migrated my website from Germany to the United States. I’ve noticed that the latency increased quite a lot.
I used an online tool to test the performance. Below is the snapshot of the result.

Obviously the bottleneck is the TTFB (Time to First Byte). 5 seconds are ridiculous given that it didn’t take too much time to reach the host.
fighternan-macbookpro% ping fighternan.com
PING fighternan.com (66.94.114.210): 56 data bytes
64 bytes from 66.94.114.210: icmp_seq=0 ttl=49 time=32.413 ms
64 bytes from 66.94.114.210: icmp_seq=1 ttl=49 time=33.306 ms
64 bytes from 66.94.114.210: icmp_seq=2 ttl=49 time=32.246 ms
64 bytes from 66.94.114.210: icmp_seq=3 ttl=49 time=38.215 ms
To dive deeper into why it took so much time, I installed a plugin called Query Monitor.

To load the main page, it took about 3 seconds totally to query the database. My database is also based in US and I’ve checked the Memory and CPU usage. Both looked fine. Database might not be the bottleneck. My next guess is that the network latency is the thing we need to improve: we should avoid query database as much as we can.
I searched a bit in the WordPress plugin market and found that this useful tool. It provides a very important cache in our case: page caching. This cache in my understanding basically spins up a background thread to crawl certain pages and stores results in some storage engine (e.g. disk, Memcache, Redis). It aims to speed up TTFB.
I then got the following performance result.
