Varnish on Magento 1

in Caching Tags: Cachemagento1performance

NOTE: Did you order a trial via (by invitation only)? Please be aware Varnish is not included in your trial.

Customers with Hypernode Professional and Excellence plans can use Varnish to boost their Magento shop. To manage and configure Varnish for Magento 1.x you’ll need Turpentine. This article explains how you can configure Varnish for your Hypernode. Do you have a Magento 2 shop, please check this article.

Although Varnish is extremely awesome when it get’s to speeding up websites, Varnish is a complex technique that needs some experience to set it up. Don’t implement Varnish on production nodes while still under development but use a development node or a Hypernode Vagrant instead.

Configure Varnish for Magento 1.x

Activate Varnish

Before installing Turpentine we recommend changing the Varnish Cache settings in your Service Panel to active (change to ‘Actief’). Once you’ve changed this setting and enabled Varnish in Magento, Varnish will store all information in it’s own cache. Only when Varnish needs data that hasn’t been cached it will connect with the server.

Install Turpentine

Installing Turpentine works best with Magento Connect Manager:

  • Log on to your backend
  • Navigate to System > Magento Connect > Magento Connect Manager
  • Fill in your admin credentials
  • Paste the following key in the field next to Paste extension key to install:
  • Install
  • Click Proceed
  • Turpentine will now be installed
  • Log off and on again so Turpentine will appear in your admin
  • Flush your Magento cache via the backend (System → Cache Management)

When the Magento Connect Manager is not available, Turpentine needs to be installed by manually:

There are a couple of options for this:
* Download and install the tarball package from the Downloads page on GitHub (note that this is not the “Download as tar.gz” option) and install through Magento Connect Downloader or Magento’s mage command.
* Install with Modman. You would just need to use: modman clone

Note: If you install with modman you should also set System > Configuration > Developer > Template Settings > Allow Symlinks to “Yes”.

Configure Turpentine

After installing Turpentine and flushing the Magento cache, you can start configuring Turpentine:

  • Log on to your Byte Service Panel
  • Select your Hypernode plan
  • Click on the tab Instellingen
  • Select the option Varnish
  • You’ll notice Varnish cache is non-active. This is necessary for testing your shop with Varnish. (See ‘Test your shop with Varnish’ below)
  • Don’t close this page, you’ll need this information later
  • Log on to your Magento backend
  • Navigate to System -> Configuration
  • Select Varnish Options under Turpentine
  • In the Servers section, fill in the following information:
    • Varnish version: leave this on ‘auto’
    • Varnish server list: Paste the content from your Service Panel here
    • Varnish authentication key: Paste the content from your Service Panel here
  • Select Caching Options under Turpentine
  • Check if the following information is correct:
    • Backend host: This should say varnish
    • Backend port: This should say 8080
    • Crawler ip’s: Remove localhost/ from the crawler ip’s
  • Navigate to System -> Cache Management
  • Enable >Varnish Pages and >Varnish ESI Blocks
  • Click Apply Varnish Config below to complete the configuration

Test your shop with Varnish

We highly recommend you to test Varnish on a staging environment first. This way you’ll make sure your shop is completely optimized and ready to use Varnish.

There are 2 ways to create a Hypernode staging environment for testing Varnish;

  1. Hypernode development plan
  2. Hypernode Vagrant

We recommend you to use a development node (which can be cancelled any time). A basic staging environment doesn’t work well with Varnish.

Debugging headers

If you want debugging headers, please remember to enable those in the admin backend under Varnish settings.

varnish headers

Depending on the version of turpentine you use, sometimes it’s needed to add your ip to the debug_acl in the vcl. This enabled debug headers for your IP address.

Varnish with PHP7

The current stable release of the Turpentine varnish extension is compatible with PHP7.

Warm your cache with the Turpentine cache-warmer script

Turpentine is shipped with a cache warmer. To use this script copy it to your home directory:

mkdir -p ~/bin; cp ~/public/.modman/magento-turpentine/util/ ~/bin/

Now you can warm your Varnish cache by retrieving the sitemap.xml:

~/bin/ -u

Which will crawl all URLs defined in the sitemap.xml:

app@gz20le-support-magweb-do:~$ bash ~/bin/ -u
Getting URLs from sitemap...
Warming 152 URLs using 2 processes...
HTTP/1.1 200 0.87 secs: 18320 bytes ==> /kamelen.html
HTTP/1.1 200 1.34 secs: 14710 bytes ==> /dromedarissen.html
HTTP/1.1 200 0.75 secs: 17726 bytes ==> /geiten.html
HTTP/1.1 200 0.74 secs: 17974 bytes ==> /tux.html
HTTP/1.1 200 0.79 secs: 14856 bytes ==> /vogelbekdier.html


  • If your Varnish setup is not working over SSL, check this article.