TLDR; Some time ago I posted on this forum that I’ll try to rewrite Apache caching guide as requested by Apache foundation. I promised to post here with progress updates. However, Apache is no longer looking for an expert to rewrite their caching guide. Because of that, I decided to try and come up with a solution similar to Litespeed caching but that works with Wordpress on Apache and is suitable for newbies. A very good Apache caching guide for Wordpress is linked further down.
A while ago, I found a section of Apache’s httpd website where the foundation is looking for contributors for specific tasks. One of those tasks was re-writing their caching guide which requires expert knowledge.
I took it as a side-project and did some tests, played around with configs and other stuff related to server level caching with Apache. I made some progress by reading Apache caching guide as well as Simon Mott’s simplified version with example for caching Wordpress sites, you can read it here .
Simon Mott operates a large site, much larger and heavier than anything we have under management or development. His own testing script returned average ~0.7s load time for his site, while the highest load time for our sites without any caching and according to his own script is a bit under 0.2s(most are 0.12-0.13s) . Because of this, I was unable to achieve the same level of performance benefits as he did. His guide is good, and I was able to set up Apache caching without issues, and it sped up our sites to the point of instant response, which is actually just a bit faster than without Apache caching.
The idea behind this was to figure out if Apache is a viable option for less skilled users next to Nginx and Litespeed. And when configured in the same way, Apache caching acted in the same way, with more or less identical response times. This was a very positive result because I was wondering if same level of wordpress performance can be achieved without using Litespeed(i.e. spending money), and it turns out it is possible and not very hard, as long as you’re caching static sites that stay exactly the same for long periods of time.
However, Litespeed has a very streamlined way of invalidating the cache through LS cache plugin, which Apache lacks. At this point, I shifted my focus away from caching guides and performance gains, and turned to streamlining cache invalidation. Reason for this is that WP caching plugins seem to take longer (about 2x page load time compared to no caching plugin) for initial page load when cache is empty, and that is also true every time the cache expires. With Apache mod_cache I didn’t even notice a difference between initial page load with and without cache enabled. I had moderate success with automated cache invalidation, but I still need more time to absorb relevant knowledge to produce a robust, reliable and easily deployable solution suitable for ordinary users and shared hosting. Right now, if a Wordpress page is updated while cached version is still valid, it breaks that page to the point where it’s barely recognizable, I couldn’t get Apache to invalidate that page with out of the box settings or anything I could find online, including Etags, headers and other built in mechanisms. It seems that .htcacheclean is the best solution for cache invalidation, and I will try to build something that utilizes it but is easily accessible through GUI/Wordpress plugins.
At this point, I was feeling confident that I can start writing a caching guide and start work on cache invalidation streamlining, eventually producing a caching guide with a complete solution for wordpress. I went back to Apache website only to find that the listing for a caching guide rewrite is gone and I can’t find it anymore. I’m not sure what happened because httpd 2.5 dev info mentions work on apache caching modules, so I guess it’s not dead. Maybe they just gave up on waiting, the listing was originally posted in 2016.
In conclusion- the current Apache caching guide isn’t terrible, it is useful but I think some practical examples for common use cases, or an automated setup would make it more appealing. Simon Mott did it for Wordpress and there are a few others dotted around but in the end they all result in a basic cache which is no different than much more popular Nginx solution. I’ll keep digging and see what I can come up with in the coming months. I’ll post here when I make progress.