In this article:
Fragment Caching is similar to Object Caching, in that it assists in improving performance by reducing the total number of database queries required to generate pages for many users. This works by freeing up MySQL server resources taken by serving repeated queries returning the same data each time, so that it has more power to handle real dynamic data.
In shared hosting platforms, you may only be able to cache files to a disk. In such cases, there is only one option available for Object Caching unless your hosting provider has a method listed under VPS / Dedicated Server or Multiple Servers available.
Disk-based caching stores the Objects to a folder within wp-content/cache as a file or set of files. Disk-based object caching is generally not recommended unless you are caching a small number of objects that are not likely to change often.
VPS / Dedicated Server
Alternative PHP Cache (APC / APCu)
APC refers to Alternative PHP Cache which provides in-memory Opcode caching and a key-value store for looking up cached items. This is largely deprecated in favor of modern Opcode Caching mechanisms, as APC is not supported in the PHP 7.x branch.
APCu is similar to APC, though in order to support modern variants of PHP it is stripped of Opcode Caching and only provides the in-memory key-value store mechanisms. When paired with modern Opcode Caching mechanisms it can provide the functionality originally provided by APC, though it should only be used when you require having a limited cache size.
APC/APCu is not stable when a lot of memory allocated. In cases where you are caching a small amount of data, APC/APCu may be the ideal method for single-instance hosting platforms such as WordPress VPS or Dedicated hosting.
eAccelerator is an in-memory Opcode caching solution that supports the PHP 4.x and 5.x major versions. This is largely deprecated in favor of modern Opcode Caching mechanisms, as eAccelerator is not supported in the PHP 7.x branch.
XCache is an in-memory Opcode caching solution that supports up to the PHP 5.6 release. This is largely deprecated in favor of modern Opcode Caching mechanisms, as XCache is not supported in the PHP 7.x branch.
WinCache (Recommended for Windows-based Environments)
WinCache is an extension for Microsoft IIS which provides in-memory Opcode caching and currently supports up to IIS 10 as of 04/30/2019. Check the official Microsoft product page for the latest information.
If you have multiple hosting plans where one plan has root-level access, or if your hosting provider offers addons or bundles providing one of the following solutions, you may offload your in-memory caching to another server. This allows you to separate your actual site and caching solution between multiple servers to compliment each other, and allows for easier scaling to serve many users.
Memcached is a high-performance, distributed memory object caching system meant to speed up dynamic web applications by alleviating database load. It provides an in-memory key-value store for small chunks of arbitrary data (strings, objects) from the results of database calls, API calls, or page rendering.
Memcached is ideal for relatively small and static data, and as a result may be more efficient than Redis. It is also multithreaded, which may be a benefit when using a VPS or Dedicated Server with a large resource pool.
Frequently Asked Questions
Enabling Fragment Caching didn’t improve my performance
Fragment Caching can help when there is a lot of dynamic content that Object/Database caching can’t resolve, though it requires a developer to tag content in pages. If you do not tag your page fragments, enabling Fragment Caching will have no effect.
W3 Total Cache
You haven't seen fast until you've tried PRO
Full Site CDN + Additional Caching Options
Advanced Caching Statistics, Purge Logs and More
Everything you need to scale your WordPress Website and improve your PageSpeed.