Yes, you should definitely use object caching for your webserver…especially for dynamic page generation. It speeds things up incredibly and can do wonders for page speed performance.
Redis and memcache are more or less interchangeable. Redis is considered the newer/faster option but real world performance hasn’t always reflected that sentiment. I naturally would try Redis first and see if it’s super fast, no weird issues. If Redis isn’t totally smooth, go straight to memcache. (Or for a totally hassle-free option, just go memcache first.) And then if you want to venture further, go with APCu. APCu is faster than both Redis/memcache but can be unstable or total memory-hog.
My advice is to try all of them and test your site for yourself. Afterwards, simply delete the ones you don’t need. You can install these modules easily…just make sure you use a version that’s supported by whatever application you’re using.
The big three in the world of object-caching:
- Redis – fast but might not be supported everywhere. Possibly the fastest/best option if you can get it to work.
- Memcache – the old (but very stable standard). Most people who haven’t played with Redis yet will go with this. I love it.
- APCu – very fast because it doesn’t write anything to the disk, simply stores it as is. Can cause problems or performance-loss in certain environments (clusters, server restarts, low memory, etc). FYI: some people say APCu is outdated and that you shouldn’t use it.
Some old ones:
- APC – abandoned and now succeeded by APCu (which supports php 7.x).
- XCache – abandoned.
Hifihedgehog
I love your articles! This is exactly my observation as well. For some reason, APCu actually causes slow download speeds for me in NextCloud. I use LiteSpeed’s specialized version of Memcached, LSMCD, though, and it completely resolves the issue. By the way, LSMCD has high availability and data persistence. For its ease of use plus this, I prefer LSMCD over Redis by a long shot.
Umair Ahmed
APCu is incompatible with IIS and Nginx on Windows servers.
Alen
Nice article.. I’m using OPcache solution since that only available on my hosting provider. APC/APCu is too old and not reliable using with PHP 7, docket cache plugin do the good jobs and works for me.
Bert
Alen, OPCACHE and MEMCACHED/APCU/REDIS are two different things (front end caching vs database caching).
You can (you should in fact) install OPCACHE and MEMCACHED together for instance.
Regards
Aditya Nath Jha
I am using Redis with W3 Total Cache, how do I know if my Redis is working properly or not? In the test connection button it does pass all tests with flying colours tho
Anon
APCu supports php 8.x now
ca
I agree. APCu is the fastest cache, according to my tests.
It is not outdated and still the best solution, I think.