WordPress caching support

bbanelli

New Member
Greetings to all,

after skimming through some posts here, I'm rather confused, so perhaps someone could shed some general light on methods and options for using caching in WordPress.

Generally, as far as I understood, there are several server side options for caching, like memcached, APC and other variants.

On the other hand, there are several active plugins for WordPress offering caching options, such as WP SuperCache, W3 total cache, WP-FFPC and such.

However, can anyone provide a "cookbook" what would be, say, "optimal" solution for caching on SSD VPS? I am fully aware that YMMV and there probably isn't a "general answer", however, WP-FFPC looks pretty interesting (it seems to be only(?) sane memory based caching system for WordPress); what are prerequisite on VPS and are there any special considerations to be taken into account? For example, at the moment, my VPS has less than 1/4 of memory utilization, so I would guess there is "space" for implementation of memory cached service for my site?

Thank you in advance for any comments and help.

With my best,

Bruno
 
Memcached and APC are solutions for 2008. This is 2015. ;)

Have KH set up Zend OPcache for you, and if you truly think you need an object cache, have them set up APCu. I'm not the best person to ask about cache plugins like W3TC since my experience is that they are akin to snake oil.

The best things you can do for WordPress performance are to select a theme that doesn't overload your server, and be mindful that many plugins cause server problems. For example, if a theme uses a "framework" (also known as bloat), it will likely be hard on your server. And stay away from certain plugins...Jetpack has a well-deserved nickname of "Bloatpack", and you don't need Wordfence if you properly set up your server-level controls (CSF, mod_security, and httpd.conf).
 
Memcached and APC are solutions for 2008. This is 2015. ;)
Honestly, I am proficient in GUI desktop development (WinAPI, GTK+ and some Cocoa) but have very limited to none knowledge about server technologies, let alone which one is modern or not.

Unfortunately, making those "popular" and available to broad population, it seems everyone "knows" so much about them; that's why I asked here instead of complying to pretty untrustworthy resources on Web... :(

Have KH set up Zend OPcache for you, and if you truly think you need an object cache, have them set up APCu. I'm not the best person to ask about cache plugins like W3TC since my experience is that they are akin to snake oil.
That is what I've understood - WP-FFPC should use APCu and that should be it.

Honestly, I was not sure about those "caching" plugins myself. Reading reviews, it seems they can bring much pain, apart from advertised joy they should. Furthermore, from what I've read here, disk caching was not recommended for production usage, but people here advised on using memory-based cache technologies for WordPress. WP-FFPC seems to be one of those.

The best things you can do for WordPress performance are to select a theme that doesn't overload your server, and be mindful that many plugins cause server problems. For example, if a theme uses a "framework" (also known as bloat), it will likely be hard on your server. And stay away from certain plugins...Jetpack has a well-deserved nickname of "Bloatpack", and you don't need Wordfence if you properly set up your server-level controls (CSF, mod_security, and httpd.conf).
Apart from customized template (it's not framework based ;)), I don't use any other plugins because I don't really need them. Site runs fairly by now, but if there are VPS resources to sare in order to increase speed, I'm not against it, frankly...
 
Hi @bbanelli,

@Dion covered the basics of this, but I thought I would explain a bit more. Essentially there are two types of caching that can be done server-side regarding this. There is opcode caching, which stores compiled byetcode from your PHP scripts. This helps cut down on the amount of work PHP has to perform, as the scripts have already been parsed. Now, if your site is very dynamic on a user basis, (e.g. your site renders differently to visitors of differing geographical locations), then this type of caching will obviously have less benefit, but this is generally true about all types of caching. Basically, Opcode caching can speed up the execution of your PHP scripts, but it also allows the server to handle a much larger volume of traffic. Zend Opcache would be an example of this.

The other type of caching would be data caching or more specifically key-value store caching. Instead of caching the bytecode necessary to render content, this caches the actual data. If your site updates very frequently this may not be the best choice, not that opcode caching and data caching can't be done together. Memcached and APC/u would be an example of this. many are also confused about the difference between memcached and memcache. Both are necessary for memcache to function. Memcache refers to the PHP module/extension, whereas memcached refers to the server daemon.

Now, since PHP 5.5, zend opcache has been included in PHP core, which lets you know the developers trust this extension and will maintain support for it. APC(a data cacher and opcode cacher) used to be the old favorite and will supposedly be included in PHP core come PHP 6, but many now opt for zend opcache as APC was beta for PHP 5.4+. If you insist on using a data-cacher, many opt for memcached, but APCu is still a possibility.

Finally, there are plugins that like to use disk caching. This is not recommended whatsoever, as it typically gets very out of hand and can easily cause the inodes limit to be reached, which can take a very long time to correct. Typically, the user notices the slowness before this happens or our Abuse Department will see the container causing stress on the node and notify the user before it gets out of hand. This is mainly due to the excessive amounts of cache files made within directories which can slow your server immensely and create very high I/O wait. While I am not terribly familiar with the WordPress side of caching, most reputable caching plugins will support data caching via memcached or APC/u as opposed to disk caching.

Also, when making use of opcode caching, your server must be using a compatible PHP handler such as DSO. Since mod_ruid2 was marked as stable, our server's are now provisioned with DSO and mod_ruid2 by default, as DSO has been generally regarded to have a less overall footprint on server resources and the mod_ruid2 now provides the same stable security benefits as suPHP. suPHP is not compatible with opcode caching.

Now it vary's on your needs and the type of sites you serve, but generally we recommend DSO with mod_ruid2 using PHP 5.5+ with zend opcache for opcode caching and memcahed for data-caching with your choice of WordPress caching plugin(NOT using disk caching).

Edit: I suppose it would also be good to talk about eAccelerator and xcache, two other opcode cachers. I think the fact that zend opcache (and hopefully soon APC) is included in PHP core, should be enough of a deciding factor when choosing an opcode cacher; however, we specifically shy away from xcache for excessive memory consumption/leaking and eAccelerator for its more recent 'buggy-ness'.

Also, note that we typically do not have any issues when installing these modules/extensions and can do so at your request when opening a ticket.

Thanks,
 
APC(a data cacher and opcode cacher) used to be the old favorite and will supposedly be included in PHP core come PHP 6, but many now opt for zend opcache as APC was beta for PHP 5.4+.

APC is abandoned. Its authors have moved on to Zend OPcache, and someone else did APCu. Here's a comment from Rasmus Lerdorf, the (former) lead author of APC and the creator of PHP:

https://bugs.php.net/bug.php?id=64625#comments_view

Also, there is no PHP6: https://wiki.php.net/rfc/php6

Now it vary's on your needs and the type of sites you serve, but generally we recommend DSO with mod_ruid2 using PHP 5.5+ with zend opcache for opcode caching and memcahed for data-caching with your choice of WordPress caching plugin(NOT using disk caching).

Something tells me that when EasyApache 4 is in general release in a few months, KnownHost will begin its move from the 2008 solution of DSO/ruid2 to the 2015 solution of MPM_Event and PHP-FPM. ;)
 
APC is abandoned. Its authors have moved on to Zend OPcache, and someone else did APCu. Here's a comment from Rasmus Lerdorf, the (former) lead author of APC and the creator of PHP:

https://bugs.php.net/bug.php?id=64625#comments_view

Also, there is no PHP6: https://wiki.php.net/rfc/php6



Something tells me that when EasyApache 4 is in general release in a few months, KnownHost will begin its move from the 2008 solution of DSO/ruid2 to the 2015 solution of MPM_Event and PHP-FPM. ;)

Yeah 6 is getting skipped. Way back when before that was decided though the talk was to include APC in v6. This has been a few years ago now.

It indeed got dumped for ZendOpcache.

As for EA4, the jury is still out on that one. It just hit cPanel EDGE builds yesterday for testing and feedback on the private mailing list has been less than friendly, especially regarding the PHP selector. Most people are saying they'd rather it simply not be included instead of cPanel's implementation of it. Personally I see the value in forcing upgrades for security purposes but alas, not everyone shares my point of view. Some don't think about security until after they've been hacked...but that's all a topic for another time.

DSO+mod_ruid2 has proved to be a great combination, but PHP-FPM (and Nginx) is indeed a better combo. I've setup Litespeed for a few customers with very high traffic sites, so large they're split across multiple KH-DS4 dedicated boxes and Litespeed + ZendOpcache with MariaDB behind it is a force to be reckoned with.
 
First of all, bit thanks to everyone for participation in this matter! Many things are more clear to me now. :)

@KH-WilliamL - so basically, I should ask support to implement Zend OpCache and memcached?

BTW, what is the difference between memcache and memcached?
 
In my experience on some insanely busy WP installs trying multiple caching plugin front-ends for Memcache/d, it made things worse. I found the best performance with no WP caching plugin or memcached, just straight WP + an Opcode cache (ZendOpcache).
 
I found the best performance with no WP caching plugin or memcached, just straight WP + an Opcode cache (ZendOpcache).
That's been my experience as well. Most (all?) WP cache plugins are rooted in old, outdated technology that was designed to work with WP sites from years ago (meaning small blog sites). Today's "mega-WP-sites" cause these cache plugins to choke on themselves and do more harm than good.

The best way to speed up a WordPress site is to use a lightweight theme and limit the number of plugins you load...
 
Sorry Freddie, my literacy was obviously on very low levels while quoting. Thanks. :)

In my experience on some insanely busy WP installs trying multiple caching plugin front-ends for Memcache/d, it made things worse. I found the best performance with no WP caching plugin or memcached, just straight WP + an Opcode cache (ZendOpcache).
That's been my experience as well. Most (all?) WP cache plugins are rooted in old, outdated technology that was designed to work with WP sites from years ago (meaning small blog sites). Today's "mega-WP-sites" cause these cache plugins to choke on themselves and do more harm than good.
Well, it would seem that ZendOpcache is only safe and sane option!

Thanks guys! :)
 
Hi @bbanelli can you tell us how your site doing after implementing ZendOpcache ?
After some tuning of options (especially regarding memory allocation), speed increases are noticeable and I haven't had a single problem since.

So if you have enough of free RAM, I see no reason for enabling this option. With SSD and "clean" template, it should be win-win-win. :)
 
Top