Report this

What is the reason for this report?

Wordpress W3 Total Cache plugin configuration with Varnish installed

Posted on February 16, 2013

Is there any tutorial to configure the W3 Total Cache plugin in droplet/server with Varnish installed? My concerns are:

  1. Do we need the W3TC plugin if we are using Varnish? If we do then how to configure the plugin?
  2. Do we need to configure the Varnish .vcl file once or everytime we setup new Wordpress site?


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In my experience we’ve ran into issues trying to use both an internal wordpress plugin with an outside cache like Varnish. <br> <br>Overall you are better at selecting one and sticking with it and alot of that also depends on what other plugins and functionality you have installed on your wordpress. <br> <br>I’d recommend using WordPress Super Cache: <br>http://wordpress.org/extend/plugins/wp-super-cache/ <br> <br>And then reviewing system performance and making adjustments if necessary. Also if you make both changes at once and start running into issues you’ll have a harder time of figuring out which one is at fault.

Or maybe we dont need W3TC at all?

Setting up Varnish and W3TC is relatively easy and can be done in 20-30 minutes, the only issue you may run into is with tokens that are generated by database management plugins or software. <br> <br>These tokens are not supposed to be cached and unless you modify the VCL to pass, you won’t be able to log-in and use them. You’ll still be able to log-in to WordPress, but if you use the Adminer plugin (either the WP plugin or stand-alone), SQLBuddy, phpMyAdmin, or other software, you won’t unless you add that pass to the VCL. I’ve still not managed to find the right line to add, though if you need a starting point, we use the configuration below on quite a few deployments. <br> <br>https://github.com/nicolargo/varnish-nginx-wordpress <br> <br>It works well and it’s really copy & paste.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.