Varnish Cache Server for Caching WordPress Websites – Is it Worth !

Varnish Cache Server System

Varnish Cache Servers are Web Accelerators

Many web host service providers such as AECNU WPMU tried running varnish cache servers to speed up the websites hosted on their servers. Varnish cache server is like an automatic web accelerator used to speed up the websites hosted on their servers. Varnish cache servers are also known as caching HTTP reverse proxy.

According to the developers of Varnish Cache System, depending on the architecture of the server, varnish cache can speed up websites in the factor of 300x up to 1000x. Varnish cache server works as an interface layer in front of web applications. It promises to speed up the hosted websites without the application of any external cache plugins.

Varnish Cache Servers – Good or Bad !

Varnish cache servers are considered good to speed up websites. It works quite well at the basis server infrastructure, although it can prove to be bad for developers who are working on CSS codes. In a nutshell, most of the customers love the speed performance offered by servers running on varnish cache system, but it has its own limitations.

Limitations of Varnish Cache Servers

Varnish cache servers are limited at two factors.

  • Varnish cache servers do not allow tweaking .htaccess file.
  • Varnish cache servers do not allow the execution of cache plugins.

Both the factors mentioned above can hamper the WordPress site speed optimization process, which could have been achieved by using some other means of speeding up websites. Even if these cache plugins work, it won’t show up. We have used and tested a varnish cache server with two cache plugins – WP Super Cache and Quick Cache (Speed without compromise).

Although, some tweaking and configuration changes on varnish cache servers are allowed, but only through cPanel. The following changes in cPanel can help -

      • Static / File TTL (mns) – 86640
      • Dynamic / Page TTL (s) – 86640

Varnish cache servers are good. In fact, we can say it is a great system, but limited at tweaking and configuration changes. We tested one of our client’s sites AQUABLUETEC to understand the performance improvement probability that can be achieved on varnish cache servers.

GTmetrix Test Report of a Site running on Varnish Cache Server

Varnish Cache Server Report on GTmetrixThe report clearly shows the problem with leverage browser caching, but we aren’t allowed to fix it. If the system could have allowed tweaking .htaccess file, the things could have been improved.

Pingdom Test Report of a Site running on Varnish Cache Server

Varnish Cache Server Report PingdomThe test report at Pingdom also tells the same story. Leverage browser caching is a problem and unluckily, we are not in a position to fix it due to the varnish cache server’s imposed limitations.

Webpagetest Report of a Site running on Varnish Cache Server

Varnish Cache Server webpagetest reportWebpagetest Report is also telling the same story, although in a different language. First Byte Time is C, which means the server is too slow to respond. Cache Static Content is also F, which means that none of the static contents are getting cached by the varnish cache server systems.

Super Tweaking by Mark de Scande on Varnish Cache Server

Mark de Scande didn’t gave up and tried his WordPress Speed Optimization Techniques to get the best speed performance on varnish cache servers.

1Quick Cache (Speed Without Compromise)

The quick cache plugin was installed and activated at our test site www.aquabluetec.com.

2.htaccess file

The file was tweaked with the following code.

.htaccess

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype

</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType text/html “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 1 month”
</IfModule>

3Configuration Changes in cPanel

  1. Optimize Website Compress all content was activated
  2. Following configuration changes in varnish cache server were done
        • Static / File TTL (mns) – 86640
        • Dynamic / Page TTL (s) – 86640

4Purge Varnish Cache

After all the above mentioned configurations were tweaked, we pulled our test website and cleared the browser cache to catch up with the updated performance results.

Once again, we did all the tests to study and analyse the performance gains (if any) on the varnish cache server running our test site.

GTmetrix Test Report Varnish Cache Server

Varnish Cache GTmetrix Test ReportLeverage browser caching is still in the problem area with its value stuck at F. No improvements, even after trying our best at the varnish cache server.

Pingdom Test Report Varnish Cache Server

Varnish Cache Test Report at PingdomLeverage browser caching is still lying in the problem area with its value stuck at F. No improvements.

WebPageTest Report Varnish Cache Server

Varnish Cache Report at WebpagetestFirst byte time moved up from F to A, great improvement as the server responded in less than 1 second. The problem with First byte time is fixed, but Cache static content is still F, no improvement due to the limitation imposed on .htaccess file.

WebHostingHero Test Report Varnish Cache Server

The report gave a score of B to the site. In general, the site was fast, running at a page load value of less than 1 second.

Conclusion

Based on the above reports and recommendations given by Mark de Scande, Joseph Anderson (CEO) AECNU WMPU says

In conclusion with testing and considerations by the Speed King Mark and the AECNU team, we have decided NOT to include Varnish on our platform at this time – at least until the end user features portion (in beta) are more responsive, concerning the disabling of the caching itself from within cPanel. Varnish performs excellent itself and is certainly a consideration for the future, when the above mentioned issue is worked out a bit more.”


- Joseph Anderson (CEO) – AECNU WPMU

Varnish cache server systems are good, but it can be better. Cache plugins and several other speed optimization techniques can be easily tweaked to get a fast running website. Competition is tough and if varnish cache systems can offer better performance and also, if it can be flexible enough to allow customisations and tweaking, it can be one of the best WordPress speed optimization systems in the future.

Update How Fast is Fast After Dumping Varnish Cache

Mark de Scande did some SUPER tweaking on www.aquabluetec.com

The Results:

1) gtmetrix.com

Latest Performance Report for  http   www.aquabluetec.com    GTmetrix

2) www.webpagetest.org

WebPagetest Test Result - Dulles   www.aquabluetec.com

3) pingdom.com

Website speed test

Recap Don’t use Varnish Cache for your Server just book me on oDesk 

Post super charged by Ashutosh Kasera

Author 


WordPress Site Speed Expert, Speeding up WordPress sites across the Globe

I am the fuel behind the high speed of innumerable fast running wordpress websites hosted either on a cheap server or a dedicated server.
Today, Speed is a matter of great concern, and I don't only optimize but re-energize. I am also a lifetime WPMU Dev member.


One of the largest free blogging websites BlogLines in South Africa is my baby. I not only conceived the idea of free blogging in South Africa, but also implemented it with an objective of adding a new dimension to the world of free blogging. Blogging helps us in enhancing the quality of our social life by transforming the ways in which we share our ideas and opinions with each other. South Africa blogging environment has never been so easy and user-friendly as it is today.

I have practised and learned all the technical aspects related to WordPress. In the past couple of years, I have developed a wide range of websites using WordPress, WordPress MU and now using the latest WordPress MultiSite.

I am the WordPress Speed Energizer Wiz, and I am always hunting around to find slow running websites. I know, these websites need me in order to live a long and healthy life.
Only the wordpress sites powered with speed, capable of running at full throttle are going to survive in this tough and competitive world of Internet.

    Follow Me:
  • facebook
  • googleplus
  • linkedin
  • twitter
  1. Mark De Scande BlogLines
    Mark De Scande BlogLines12-27-2013

    Varnish Cache is it worth it the sort answer is NO

  2. Per Buer
    Per Buer02-11-2014

    This is sort of flawed.
    1) You state Varnish will interfere with CSS tweaking, without giving any details. That's just plain wrong. You can tweak the CSS all the you want, Varnish will of course serve it.

    2) You say Varnish will not allow you to leverage client caching. This is also not true. Client caching happens through Cache-Control headers, which Varnish will not touch unless you tell it to do so. If the application disallows client caching then, unless you tell Varnish to override the headers, client caching will be disabled.

    3) You say you cannot change .htaccess files when using Varnish. Varnish doesn't care about .htaccess files, but Apache will continue to honour them. Just bear in mind that not all requests will hit Apache and therefore you might need to flush content from cache before .htacess rules are taken into account.

    How well Varnish works for you will depend on how well the application has been integrated with the cache or, if it isn't, how you set it up. There are basically no limits to what you can do with Varnish when it comes to caching but if the application doesn't support it it will not work out of the box. You'll need to spend a couple of hours reading some documentation in order tweak it if doesn't work. And most importantly, you need to understand what it does and what it doesn't do.

    Cheers,
    Per.

  3. Mark De Scande BlogLines
    Mark De Scande BlogLines02-13-2014

    @Per Buer Thank you for your comments :) please dont forget i was the end user not the host that installed the cache system

    1) Well it did i could need see any of my CSS changes even after clearing the cache in cPanel

    2) It did not work with the setup at all

    3) htaccess i added all my tricks and no luck

    @Per Buer you have it spot on i did not read the documentation as it was added but the host and not by me, i was just the end user, the hosting environment is on a VPS with only WHM and cPanel but i can not add anything to the VPS

Leave a Reply