MSCache Varnish Purge helps WordPress administrators purge the Varnish cache for sites running behind a Varnish HTTP reverse proxy. It is developed by Managed Server S.r.l. and provides settings for configuring the Varnish connection, automatic cache invalidation when content changes, and manual purge tools available from the WordPress admin area.
This plugin is useful when your WordPress site sits behind Varnish and you need cached pages to be invalidated after content is published or updated, or on demand. It requires a reachable Varnish instance whose VCL is configured to accept PURGE requests from the WordPress server (see the FAQ for a reference VCL).
The settings page is available at Settings MSCache Varnish Purge. On WordPress Multisite, shared connection settings are configured at Network Admin Settings MSCache Network, while each site keeps its own purge options.
ms-cache: excluded HTTP header, which can be used by Varnish to skip caching.The plugin opens a raw TCP socket to your Varnish server and sends an HTTP PURGE request with the appropriate Host header. The socket is closed immediately after writing the request — the plugin does not wait for Varnish to respond. This “fire and forget” approach is designed to avoid blocking the WordPress request while the purge is processed.
This plugin optionally connects to the following external services when configured by the administrator:
Cloudflare API — When the Cloudflare integration is enabled, the plugin sends cache purge requests to the Cloudflare API v4 (https://api.cloudflare.com/client/v4/) to synchronize Varnish cache invalidation with Cloudflare CDN edge cache. This requires a Cloudflare account, a Zone ID, and an API Token with “Zone.Cache Purge” permission. No personal data or visitor information is transmitted — only URL paths and authentication credentials are sent.
Varnish Cache — The plugin opens raw TCP socket connections to a Varnish server at a user-configured IP address and port (default: 127.0.0.1:80). This is typically a localhost connection to infrastructure managed by the site administrator. No external third-party service is contacted for this functionality.
When debug mode is enabled by the administrator, the plugin logs technical data (URL paths, timestamps, socket connection status, purge results) to files in wp-content/uploads/mscache-logs/. Log files are protected with .htaccess rules, obfuscated filenames, and an index.php guard. No personally identifiable information (PII) or visitor data is collected, stored, or transmitted. Purge statistics (success/failure counts, recent activity) are stored in the WordPress options table and are visible only to administrators.
Choose which content changes trigger automatic cache purge:
Three methods are available:
/purge-all). Useful when your VCL maps a special path to a full ban.Important: The actual behavior of a full purge depends entirely on your Varnish VCL configuration. The plugin only sends the request — it is your VCL that decides what gets purged.
Enter one URL per line (absolute or relative paths). These URLs can be purged:
Define patterns (one per line) for URLs that should be excluded from caching. Two matching modes:
* (any characters) and ? (single character). Example: /wp-admin/*, /cart*, *.xmlWhen a frontend request matches an exclusion pattern, the plugin sends the HTTP header ms-cache: excluded. Your Varnish VCL can check for this header and bypass caching accordingly.
Lines starting with # are treated as comments and ignored.
Matching is performed on the request path only, ignoring the query string.
This plugin is provided “as is” under the terms of the GNU General Public License v2 or later. MANAGED SERVER S.R.L. does not warrant that the plugin will function correctly on hosting environments, servers, or Varnish configurations not directly managed by the company. The plugin has been tested and validated exclusively on the Managed Server hosting infrastructure. Use on third-party environments is at the user’s sole risk and responsibility. In no event shall MANAGED SERVER S.R.L. be liable for any direct, indirect, incidental, or consequential damages arising from the use of this plugin outside of the Managed Server infrastructure.