Varnish W3TC and Backups
I had to restore an earlier backup of this blog this week….twice hehe.
No matter what i did, i couldn’t get the loading time down really, and was about to give up on that idea…when Emma dropped me a message about problems with Varnish. Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. So after figuring out why Emma’s sites werent’t working with Varnish turned on, i installed it on my box. Unfortunately things must have gone south at some point, thumbnails broke, the NextGen Gallery didn’t work too well either and the loading time went from just above 1 second to 2.8 seconds on average. Not exactly the effect Varnish is supposed to deliver.
And the worst thing was that i couldn’t get the loading time back to where it was before. I uninstalled Varnish, switched settings in WHM back to what they were before and even recompiled Apache/PHP. No matter what, the site wasn’t loading as fast as it did before me screwing it up. That’s where i made the decision that all is lost and reinstalled WHM/cPanel from scratch and restored a backup from mid January 2015. Good news were that only two or three posts got lost, everything else was there and after reinstalling everything and restoring the backup the page loaded in just above a second again (cached version using W3TC).
Today i thought i have another go at it and do the Varnish thing again, this time reading the documentation more thoroughly and hoping that it works this time as i haven’t tweaked much since i restored the backup. So i went and installed Varnish, changed the Ports in WHM and /etc/sysconfig/varnish, checked the configuration and was surprised that Varnish worked just like that. Except for a few file edits and one change in WHM there was no hassle configuring and installing Varnish. I will list the exact steps i did to get Varnish working on my WHM/cPanel install a little further down this post. For now let me brag with the results of GTMetrix.com and Pingdom.
Additional information on how i installed Varnish Cache on my server can be found on page 2.