Sydney Magento Meetup

Accelerating Your Magento

Website with Varnish Cache


  • Squixa and
  • Why you need a fast website
  • Problems making Magento fast
  • How to make your website fast using Varnish
  • Implementing Varnish Cache
  • Demo - View of Varnish Cache from

Squixa and

  • We do web performance
  • Web optimisation platform (CDN, Site specific optimisations and metrics)
  • Performance consulting
  • At least half our clients run Magento
  • - New Varnish as a service platform

Why you need a fast site


Google study - 0.5 seconds slower = 20% less clicks

Amazon study - 100ms faster = 1% revenue

  • SEO (and Site speed)
    • Organic search 
    • Adwords (PPC performance - landing pages)

The Problem - Why sites are slow

  • 2 broad areas that make up page load (Frontend/Backend time)
  • What is a page load
    • UX of: A click through to completed page
    • A number of events happen end to end
    • Identifying which events are causing issues

Page Load Technical View

  • Backend time = HTML Document
  • Frontend time = Just about everything else

Why sites are slow

  • General industry best practice = 80% frontend
  • We have found ~50% of Magento page load is spent in backend
  • Frontend performance issues are easier to solve
    • CDN's
    • Review javascript executing on your site
    • Optimise images

How to solve backend performance

  • HTML document performance issues are hard
    • Code scope - Your code, Magento code, Extension code
    • Magento Architecture - Inbuilt issues
  • HTML document generation is important to improve
    • Seeing nothing is ugly
    • Most of your hosting cost is spent making HTML documents (Server CPU)
  • Caching HTML documents in Varnish Cache eliminates performance issues
    • Varnish - Introduction

Varnish Cache

A caching HTTP reverse proxy

Decide Cacheability

  • Must be a GET request, not a POST.
  • No cookies in the request.
  • Response Cache-Control header allows caching.
  • No cookies in the response.

Improve Caching

  1. Identify which resources are user-specific.
  2. Strip cookies from non-user specific requests and responses.
  3. Tune the Cache-Control response headers.
  4. Integrate with Magento via Turpentine.

Install Varnish Cache

apt-get install Varnish Cache


yum install Varnish Cache

Install Turpentine

  • Magento Connect or ...
  • Run modman clone or ...
  • Download .tar.gz and run mage.

Configure Varnish Cache and Turpentine

Varnish Operations

  1. varnishlog
  2. varnishtop
  3. varnishstat
  4. varnishhist

Varnish and Magento Development

  • Effective Varnish Cache is tailored for your site
  • Changes to your site will be reflected in Varnish Cache

Varnish High Availability

  1. Varnish exists between your users and your website.
  2. Varnish's state is mostly ephemeral.

Varnish at Squixa



Thank you

  • Matt Johnson <>
  • Jason Stangroome @jstangroome