Make WordPress Page Cache Plugins Fly on Nginx
This was a great little read about server performance matters from Ashley Rich over at Delicious Brains. While I think most WordPress users (and even most WordPress developers) don’t really need to be expert server administrators, at least delving into the topics from time-to-time is super valuable if you’re going to be the most skilled developer you can be, and understand how parts outside of your “core stack” interact.
For those totally new to the concept of WordPress servers, check out our “WordPress LAMP” article. For those who are a little more experienced, head over to Ashley’s article. He does a good job bringing you up to speed on the core concepts involved in using Nginx instead of Apache, and how it’s different caching choices work. It’s a lot to learn, but not more than I’m confident that you can manage.
The highlight for me is just that he thought to, and did, try to combine a Nginx trick with a simple WordPress caching plugin. That had never occurred to me. Here are his conclusions about that:
I have to admit, I’m surprised by the results. I expected Simple Cache + Nginx Try Files to perform much better, but I never expected it to outperform Nginx’s native FastCGI Caching. I can only conclude that there must be additional overhead due to Nginx determining if a cache entry is still valid. Whereas
try_filessimply checks for the existence of a file.
In reality, the difference between Nginx FastCGI Caching and Simple Cache + Nginx Try Files is negligible and both caching solutions are excellent options (depending on which users Nginx and PHP run under). However, going forward I think I’ll be using Simple Cache + Nginx Try Files because it provides much more flexibility when it comes to purging the cache.