I currently have varnish setup on my server. I'm also using the W3 Total Cache plugin to speed up the site through a CDN.


Is there any point in using varnish if the pages are being cached and severed through the CDN? (Does this make varnish redundant).

closed as off-topic by Mark Kaplun, birgire, Johannes Pille, gmazzap, Pieter Goosen Aug 26 '14 at 4:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Mark Kaplun, birgire, Johannes Pille, gmazzap, Pieter Goosen
If this question can be reworded to fit the rules in the help center, please edit the question.

  • If you have a custom setup that even serves the WordPress pages through the CDN, then, Varnish is indeed redundant. If it is a traditional setup, then W3 Total Cache can only serve static content via CDN (as already mentioned by Damien). In that case, Varnish is probably still useful. – Pothi Kalimuthu Aug 11 '12 at 2:45

It may seem a bit of an odd question ... but it does have a bit of an easy answer.

I've been using W3 Total Cache on a multi-server setup for WordPress for 6+ months. For this project we decided to use memcached and not varnish.

About WC Total Cache and CDN
In W3 Total Cache you only sync static files like the theme files, CSS and images to the CDN.

CDN Settings W3 Total Cache

What does Varnish do for WordPress?
Dynamic content such as requests for posts and pages is managed by WordPress and your WordPress database.

Varnish will be used to cache your most commonly served pages. Rather than requesting a post / page and its content from your WordPress database, Varnish stores these pages.

This will reduce the number of database queries and give your website a bit of a performance boost.

  • From what I know, Varnish can not be used for database queries. If there is a way, I'm all ears. It is a full-page caching engine that is more useful for caching dynamic content (for static content, there are other ways to improve the performance such as the use of CDN). – Pothi Kalimuthu Aug 11 '12 at 2:40
  • @PothiKalimuthu I guess I was being 'literal' - Varnish is a web app accelerator which caches often requested pages. WordPress is dynamic and stores its pages in a database. Therefore Varnish reduces requests to your database by caching these full pages. What do you think? – Damien Aug 11 '12 at 8:16
  • Hi Damien, I completely understand what you tried to say in your original answer and in your comment, but both could be misleading for someone new to Varnish or WordPress caching. I am no expert in these fields. So, I wish I'm wrong. – Pothi Kalimuthu Aug 11 '12 at 12:10
  • Hi Damien, I removed my downvote and upvoted now after you clarified (in your answer) about where Varnish comes into play in caching. Thanks for the detailed answer. – Pothi Kalimuthu Aug 12 '12 at 2:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.