Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

Question:

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

share|improve this 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 Aug 11 '12 at 2:45
add comment

1 Answer

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.

share|improve this answer
    
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 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 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 Aug 12 '12 at 2:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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