logo with cloudflare nginx redis and wordpress

Sometimes, it’s more quick to spoon WordPress instead of another system to do a blog.
Now, it’s time to have cache and gain good improvement about rendering.

1. The right web server

I use Nginx with PHP-FPM to be the secure base: 2019, no more Apache2

It’s also possible to implement cache at Nginx level but I don’t use it. I prefer to improvement related to metrics.

2. JS/CSS/HTML optimizer (optional)

I tested Autoptimize and finally it’s interesting when you use Elementor.
This blog, doesn’t use Autoptimize because during the test: 0kB… impossible to optimize more.

3. In-memory caching

It’s time to use Redis with Redis Cache.

WordPress will refresh cache inside Redis after posting, commenting… and all read will go to Redis. It’s a good improvement and a new way to don’t use Varnish or Nginx cache immediately.

4. CDN

It’s the last step with Cloudflare.
The free version works great for personal site/blog.

Other improvements

What are next possible steps to improve performances:

  • replace PHP-FPM by HHVM
  • replace WordPress code (core + plugin) to read from Redis by Lua code directly inside Nginx configuration
  • activate Nginx cache
  • Migrate WordPress to static website (Jekyll, Hugo)
  • Build a 2 steps prod :
    – edit and publish to WordPress offline (internal)
    – CI/CD to convert WordPress to static website and push rendered static website to public server

Don’t forget to protect your WordPress