Batcache for WordPress

repository·master·Indexed 43 days ago

https://github.com/automattic/batcache

A WordPress caching plugin that uses Memcached to store and serve rendered pages. Designed for high-traffic environments and multi-server setups, Batcache provides shared memory storage to ensure consistency across servers and reduce CPU and database load.

Tokens
441
Snippets
1
Records
3
Agent score
5%

What's inside Batcache

  1. When to use Batcache vs WP-Super-Cache

    master

    Batcache is a Memcached-based caching solution designed to serve rendered pages and optionally redirects.

    Use Batcache if:

    • You are running your site on more than one web server. Batcache allows all servers to share the same Memcached storage, ensuring consistency.
    • File-based caching is not practical or desired in your environment.
    • You need to handle massive traffic spikes by serving slightly older pages to new users to reduce CPU and database load.

    Use WP-Super-Cache if:

    • You are running a standard blog on a single server and prefer file-based caching.
  2. Install Batcache in WordPress

    master

    Follow these steps to install and activate Batcache on your WordPress site. This assumes you already have a working Memcached backend.

    1. Upload advanced-cache.php to your /wp-content/ directory.
    2. Activate Batcache by adding define('WP_CACHE', true); to the top of your wp-config.php file.
    3. Verify the installation by reloading a page in your browser and viewing the page source. You should see Batcache statistics located just above the </head> closing tag.
    4. (Optional) Upload batcache.php to the /wp-content/plugins/ directory.
    5. Tweak configuration options located near the top of advanced-cache.php to suit your needs.
    // Add this to the top of wp-config.php
    define('WP_CACHE', true);