Update January 13th, 2017: You can find an up-to-date article about how to use Magento 2 and Varnish 4.1 in the Varnish Software Web Developer Wiki: Step-by-step guide to making your Magento2 site fly. The wiki contains VCL snippet examples, tips and tricks for web developers using Magento and guides for other e-commerce and CMS systems as well.
Here is a series of posts highlighting Varnish Cache and its usage in the real world, solving real problems.
HTTP is the universal transport protocol and the only universally deployed API accross devices, clients, servers running all kind of operating systems. Varnish Cache being the HTTP "Swiss Army Knife" or the HTTP "Husqvarna Extreme Logging Chainsaw" if you will, can potentially be used to solve lots of different problems. At Varnish Software I am in contact on a daily basis with people using Varnish to do things we had not even thought of after all these years of making and providing services for the software. With Varnish you can compress, cut&paste, upgrade, secure, add performance and speed up your website's content delivery, and a whole lot of other things that I will blog about the coming months.
Today i will have a take on Magento, a fast growing Open Source E-commerce platform which is known for being flexible, but not so much for being fast. Enter:
Since my last post on this subject, many things have happened in the Magento world, with the main highlight being that Magento Inc was bought by Ebay, which was not really surprising as they made an investment in the company already in early 2010. Still, this means that the Magento Platform has a rather interesting future as a crucial piece for eBay's success (as are PayPal and X.Commerce). So without any further ado:
This is what is up in the interwebs regarding Varnish and Magento! And I see two main trends:
As I will focus on the people doing great work in this post, I want first to give a piece of advice to those relying on random code and configuration files:
Your (or your customer's) e-commerce site is the last possible place on the web where you should be testing random VCL snippets and unknown PHP code on. It is easy to write a how-to but it is hard to maintain it, specially as software develops and things change. People create and maintain software for a reason, so when doing performance related changes to your website, think twice! Be careful not to burn your revenue stream.
If you still want to go this road I have two choices for you:
If you have time and no deadlines: DIY Magento+Varnish is the solution for you. Learning how to use Magento, understand HTTP Headers and get a hold of reverse proxy caching and Varnish Cache specifically will take you some time. For you I have one piece of advice: “There are only two hard things in Computer Science: cache invalidation and naming things.” quote originally from Philip Lewis Karlton. Good luck!
As I stated above: Unmaintained and outdated information applied wrongly is self-harming. Once that is said, there are lots of nice written blogs on how to architect and deploy a website running Magento and accelerate it with Varnish Cache. As usual, google is your friend here. Good luck to you too!
Some people take pride in their job and take it serious. People that do so often achieve what is described as success. Putting your eggs in the right basket is what you have to do. Doing the right thing means choosing the right plugin for you! So, instead of doing things all by yourself, try and use someone else's software and help them make it better if you want. To the table I bring to you (in chronological order of development):
As you see there are many solutions you can use, have a look and decide for yourself. My pick:
The most feature rich solution is the Pagecache powered by Varnish, by Phoenix Media. Also I believe this to be the best case of professional Magento Varnish acceleration as it combines support while staying community friendly, very much as Magento Commerce itself. It comes in an open source version and a commercially supported version for Magento users wanting even more features and support for a critical piece of software. Also they have a good track record of making Magento plugins, so you can feel safe that they are not experimenting while aiding you to add better performance to your webshop.
Now that you have discover the power of Varnish Cache, why not deploy it on a cluster and serve all your websites, not only Magento, with it?
For that Varnish Software offers Enterprise Subscription services which include our professional support from core developers, Open Source assurance, IP infringement protection and specialized key tools, such as the Varnish Administration Console for management and real-time monitoring of your group(s) of Varnish Cache servers, created by the makers of the software. Read more on our subscription levels and price plan, and once you are ready send us a request and I will gladly help you figuring out the best solution for you and your e-commerce site.
Learn about how Magento users and other customers have benefited from using Varnish Plus.