Last updated on

If you have a WordPress VPS or Dedicated hosting, you may use an in-memory caching solution rather than exclusively caching to disk. In-memory caching takes advantage of the much faster read/write speeds and lower latency of accessing data from system memory compared to disk-based alternatives.

In-memory caching solutions may also be ideal if your disk cache is likely to fill your disk with cache files, and you would prefer to have an automatic maximum limit on the amount of storage that is possible for caching to consume.

Speed Up Your WordPress Website.

A Difference of Just 100ms in Page Load Speeds Can Cause a Visitor to Prefer Your Competitor’s Website.

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 is 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 VPS or Dedicated hosting.

eAccelerator

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

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 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.

Caveats

These solutions are mostly intended for use in hosting plans that provide a single account where you either have elevated privileges to install custom software, or a hosting provider that is able to make these changes for you.

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.

6 thoughts on “Configuring Page Caching in W3 Total Cache for VPS or Dedicated Hosting

  1. Hello,

    I am installing free w3 total cache plugin in my wp website but I am getting below error

    Error:-

    FTP credentials don’t allow to write to file/var/www/html/wordpress/.htaccess
    W3 Total Cache Error: Files and directories could not be automatically created to complete the installation.

    Please let me know how can I fix this issue?

    Thanks in advance

    • Hello,

      Thank you for reaching out and I am happy to assist you with this.
      W3 Total Cache needs write permission for .htaccess file, so yes you should change it to 644.
      Make sure that if you have multiple .htaccess files the correct one is updated with permissions.
      Once done, you should only refresh the wp-admin dashboard and the notification should not be there anymore.
      I hope this helps!
      Thanks!

  2. “APC/APCu is not stable when a lot of memory is allocated. In cases where you are caching a small amount of data, APC/APCu may be the ideal”

    Could you please clarify what is means “a lot”? 512MB is it a lot? Or a lot it’s 4GB?
    The same about “small amount of data”.

  3. I am confused by this article. It is supposed to be about configuring page caching on a Virtual Private Server or a Dedicated Server, but all it seems to talk about is opcode cache.

    Am I missing something?

    • Hi Jenny-
      APC, xAccelerator, xCache and WinCache are all memory-based caching solutions that can be used both for Page Cache. Opcode cache is usually provided by Zend Opcache or APC/APCu

Leave a Reply

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

W3 Total Cache logo

We Can Help Optimize Your Website

Optimize your site’s performance with our one-time premium services or ongoing monthly VIP support. View services

Partners

Bunny CDN Logo