I set “memcached” for the option “Page Cache” in the W3 Total Cache plugin in WordPress.
I read some posts which suggested to set “Disk: Enhanced” for “Page Cache.”
In this case, is it desirable to set “memcached” for “Page Cache” in W3 Total Cache? (For your reference: the memcached size has been set to 1024 MB.)
Thanks.
For a single Linux server memcached might be slower than file cache especially for wordpress since it’s mostly static data.
While memcached is saving everything in RAM avoiding disc IO, it’s a separate server and PHP is getting the data via TCP.
If you have enough RAM frequently accessed files on the disc will be cached in RAM and accessed more directly and faster than data in memcached.
This is an old benchmark but I don’t think that much has changed:
https://www.percona.com/blog/2006/08/09/cache-performance-comparison/
I have checked myself recently and File Cache is roughly 2x faster than memcached on reading – when memcached server is on 127.0.0.1 aka localhost.
UPDATE: When using memcached on the same server as the application. It is possible to set it to use Unix sockets instead of TCP.
It’s more difficult to configure but it makes memcached around 30% faster which is comparable to File Cache speeds.
It depends on your server configuration. If it is available, configured correctly and there is sufficient RAM available then in most cases it is recommended to use memcaching because it is faster than the disk-cache. But there is no solid ‘yes’ or ‘no’ possible because it does depend on factors of your server environment.