Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WordPress Varnish

WordPress Varnish is a simple plugin that purges new and edited content.

Does this just work?


But how should my varnish configuration file look like?

I have provided a simple VCL that can be used as a reference.

Does it work for Multi-Site (or WPMU)?

Yes. Activating the plugin site-wide will provide the functionality to all blogs. Configuration can be done on the blogs individually, or can be global. If you want to configure Varnish servers globally, edit wp-config.php and include these lines just before "That's all, stop editing!" message:

global $varnish_servers; $varnish_servers = array('',''); define('VARNISH_SHOWCFG',1);

The varnish servers array will configure multiple servers for sending the purges. If VARNISH_SHOWCFG is defined, configuration will be shown to all users who access the plugin configuration page (but they can't edit it).

My Plugins are seeing the Varnish server's IP rather than the websurfer IP

You could install Apache's mod_rpaf module: http://stderr.net/apache/rpaf/

or, in wp-config.php, near the top, put the following code:

$temp_ip = explode(',', isset($_SERVER['HTTP_X_FORWARDED_FOR'])
(isset($_SERVER['HTTP_CLIENT_IP']) ?
$remote_addr = trim($temp_ip[0]);
$_SERVER['REMOTE_ADDR'] = preg_replace('/[^0-9.:]/', '', $remote_addr );

The code takes some of the common headers and replaces the REMOTE_ADDR variable, allowing plugins that use the surfer's IP address to see the surfer's IP rather than the server's IP.

Requires: 2.9.2 or higher
Compatible up to: 3.6.1
Last Updated: 3 years ago
Active Installs: 1,000+


5 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1