W3 TOTAL CACHE to another page caching plugin

Q: I’m looking to move from W3TC to another page caching plugin, but need to replace the object caching. I’ve tried the drop-in plugins (object-cache.php) for xcache, APCu, and Memcached but they lead to a huge increase in TTFB. It went from to 13.8 secs. I’ve done a significant amount of Googling, but haven’t discovered how I can track down this slowdown. I’m on centos 7, Apache/2.4.6, and php 5.5.36.

CPU use climbs significantly, but RAM isn’t an issue — plenty free. Suggestions on how I might track this down?

A: Upgrade to PHP 7.0. Install Cache Enabler or WP Super Cache or WP Fastest Cache (they are simple and work well). Install NGINX as reverse proxy in front Apache. Install Redis instead of memcache as generally, WordPress and popular plugins work great with PHP 7.0, just remember to turn on NGINX microcaching.

Comet Cache Pro has an inbuilt manager for opcache. I found a good Redis cache in the repot a few days ago (Redis Object Cache). I find Redis runs wild with resources when not managed. I’ve used WP-FFPC in the past, which worked well at the time. Make sure to read the bottom note below here…

As Liew says, PHP 7 will improve things. Make sure PHP is properly configured to limit memory cache sizes and to limit execution times etc… I’m not a fan of WP Super Cache though. Use an up-to-date version of MySQL or MariaDB (MariaDB works well).

Many WP cache plugins use the advanced-cache.php drop-in and/or the object-cache.php drop-in under wp-content. Those that use the same file(s) are not normally compatible with one and other because they overwrite each other’s settings. Redis Object Cache (in the repo) uses object-cache.php. Comet Cache (& the Pro version) uses advanced-cache.php so Redis Cache and Comet Cache can work together within the same site. WP-FFPC uses advanced-cache.php so is incompatible with Comet Cache (and most other cache plugins). With something like WP-FFPC you may want to consider use of Autoptimize to concatinate and strip whitespace, depending on your server set-up.

I’ve had really good luck with comet cache and I also cheat a little bit my making a ram file system and mounting it then pointing the cache directory in Comet Cash to that mount point as it’s caching directory. That way everything is cached in RAM, no disk to wait for to serve any cached page.

I moved to nginx and php 5.5.38 and things are much faster. However, the object-cache.php drop-ins still cause significant speed decreases and cpu usage. So I still need to look into that. I’ll be testing with php7 over the next several weeks and hope to make the move soon.

Thanks for the insights and suggestions, everyone…very helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *