It generally makes sense to use an object cache (that’s different than a page cache like guest page caching). A WordPress object cache does things like internally fetch WordPress options, so not needing to make database queries for those can be a big speed improvement for high traffic sites.
Personally, I use one for Memcached, but I also have my own servers, so not everyone will have access to a Memcached instance.
Again, just to be clear… an object cache doesn’t replace a page cache. An object cache is used internally by WordPress for its internal objects (like options).
Thread Starter
Anonymous User
(@anonymized-23336172)
Wow, thanks for the fast reply and the detailed explanation!
The site is hosted on “old” IONOS webspace. As far as I can tell, it uses something called “OPcache” and that seems to simply be a default PHP thing. I don’t think I could get access to something like Memchached.
I guess I’ll have to dig through the list of WP cache plugins that would serve my purpose. Is there anything I should be aware of when pairing one of them with Cloudflare’s page cache?
You are correct that OPcache is a general PHP thing (it allows PHP to keep individual PHP scripts pre-compiled and in memory rather than compile them all every time a request is made). It’s good your server is using OPcache, but it’s also not a page cache or an object cache.
The one I use personally is a little old, but object caching doesn’t really change… it either works or it doesn’t. The one I’m using does support disk-based object caches (so not just limited to Memcached). But… seeing how it hasn’t been updated (even just to say it supports new versions of WordPress) is a little worrying. This is the one I use: https://wordpress.org/plugins/object-cache-4-everyone/
…but also don’t take it as an endorsement. I use it strictly for Memcached, and I actually made some changes to it to better support my setup (multiple servers and multiple Memcached servers).
Oh, I forgot to mention that the way that WordPress object caching works internally, you should be fine with any object cache. There should be no reason that one wouldn’t work with this plugin (or any plugin for that matter).
Thread Starter
Anonymous User
(@anonymized-23336172)
That’s good to know. And thanks for providing an example and explaining the intricacies.
I found a couple of alternatives. Some of them include Cloudflare caching options. Am I right in assuming that I shouldn’t enable those options and pair them with your plugin’s page cache integration? And if so, would it make more sense to let a dedicated caching plugin handle the Cloudflare caching stuff or keep it disabled and have your integration deal with Cloudflare cache?
You really don’t want to use Cloudflare as an object cache. While it technically could be done with the Cloudflare key-value service, it would make your site slower. Making a network connection to a remote Cloudflare server every time WordPress tries to read an option is going to be *much* slower than doing a database query locally on your server.
I’d probably just stick to something simple/purpose built. I ended up going with the object cache I linked before because I wasn’t trying to have a plugin trying to do anything I didn’t want it to do. I wasn’t looking for it to be doing other speed optimizations or SEO or anything else. I just wanted an object cache. Nothing more. But, that’s also just me… if you want something to do more than just an object cache, that’s up to you.
Sorry I can’t give better guidance. If your site is low-volume, it might not even make sense to have an object cache as it does add a little more complexity. So no object cache is an option too.
Thread Starter
Anonymous User
(@anonymized-23336172)
Thanks again, your efforts are much appreciated. Your dedication to free and fast support is impressive.
I guess, I’ll simply test a couple of cache plugins and see how they influence the performance. And if that doesn’t do anything notably I’ll go back to none, since, as you wrote, the site doesn’t have a lot of volume and isn’t meant to (right now).
Yep, no worries… if your site is “normal” (specifically most traffic comes from users that aren’t logged into WordPress accounts), your biggest benefit is probably going to be the page caching from this plugin. If 95% of requests don’t even need to go to your server (they are served directly from the Cloudflare data center closest to the user), any other caching on your server becomes a little moot because the request never even goes that far.
That being said, OPcache at the PHP layer is *always* going to be beneficial, as is object caching at the application (WordPress) layer. However, the guest page caching is going to be the most beneficial under normal circumstances.