Wordpress w3total cache: Disk, Opcache or memcache Wordpress w3total cache: Disk, Opcache or memcache wordpress wordpress

Wordpress w3total cache: Disk, Opcache or memcache


The answer to this question is effectively 7 years old, so I'll update the answer here. Please note that I am assuming that you are using W3TC for your website.

Disk Cache

Disk cache can generally be used for website with low/medium traffic. One of the problems with high traffic website is that Disk Cache gets corrupted if you use it with Object Cache and Database Cache.

On a medium/high traffic website running on a single server I would recommend the following:

  • Page Cache : Use Disk Cache Enhanced
  • Object Cache : Use Memcached
  • Database Cache : Use Memcached

OPcache

OPcache stores the compiled PHP code in the memory and definitely increases the code execution speed.

It is important to understand that the OPcache is a PHP Code Cache and does not store any pages, database queries or objects.

You can read more about OPcache here:

https://www.sitepoint.com/understanding-opcache/

MemCached

Memcache stores data in the RAM as key-value pairs and definitely improves the speed of the website as accessing the memory is much faster than accessing the Hard Disk.

Please note that MemCached will increase your memory usage significantly so it's definitely worth trying different configurations on test environment.

You can read more information on how to install Memcached on a Linux Server here: https://easyengine.io/tutorials/php/memcache/

Hope this will help :)