WordPress plugin / Edge cache integration

Purge exactly the right pages,
the moment they change.

Hook WordPress into Varnish Cache or Nginx Proxy Cache without ACLs, extra services or guesswork. Edit a post, the plugin sends targeted PURGE requests to every backend you listed, keeps the rest of the cache warm.

WordPress 4.0+ PHP 5.2.4+ Varnish 3.x / 4.x / 5.x Nginx Proxy Cache License GPL-3.0

Built for the way edge caches actually behave.

§ 01 Capabilities
Precise purging

Only the pages the edit affected

The post itself, the front page, and the categories and tags it belongs to. Nothing else is dropped, so hit rates stay high through editorial churn.

Any topology

Unlimited backends

Point the plugin at a single Varnish box, a pool of ten, a Varnish cluster behind Nginx proxy cache, or a mix. Each PURGE fans out in parallel.

No ACLs needed

Purge-key authentication

When exposing a management ACL is not an option, authenticate purges with a shared secret in a custom header. Setup is one VCL line.

Debug console

Manual purges with regex

Flush a single URL, a folder, or a regex scope from wp-admin. Every request is logged with the backend hit, response code and latency.

VCL generator

Starter configs you can read

Fill in backends and ACLs, download a working VCL for Varnish 3, 4 or 5. Readable, commented, ready to extend.

Multisite ready

One config, every subsite

Set backends once in wp-config.php and every site in the network inherits them. DNS names expand on load, so a pool of ten resolves without hard-coding IPs.

Install in four steps.

§ 02 Setup
01

Install the plugin

Upload the ZIP through Plugins › Add New, or wp plugin install from the shell.

02

Paste the config block

In wp-config.php, above the stop editing line. Values survive plugin updates.

03

Point Varnish at the backend

Use the generator in the admin UI, or the sample VCL in /varnish-conf/.

04

Activate the plugin

First page view warms the cache. Edit a post to see the targeted PURGEs in varnishlog.

wp-config.php
// Varnish Caching: fleet-wide settings. Overrides the DB values.
$GLOBALS['vcaching_config'] = [
    'varnish_ips'          => 'cache.example.com',  // DNS expands to all A records
    'varnish_backends'     => 'localhost',          // resolves to this host's FQDN
    'varnish_acls'         => 'localhost',
    'logged_in_cookie'     => 'wordpress_logged_in',
    'homepage_ttl'         => 120,
    'ttl'                  => 120,
    'dynamic_host'         => 1,
    'https_also_purge'     => 1,
    'purge_key'            => getenv('VCACHING_PURGE_KEY'),
];

Compatibility and provenance.

§ 03 Reference
Plugin name
Varnish Caching
Version
1.9.2
WordPress
4.0 - 7.1 (tested)
PHP
5.2.4 and up
Varnish
3.x, 4.x, 5.x
Nginx
Proxy Cache with PURGE method
Multisite
Supported, network-wide config
License
GPL-3.0-or-later