1. Home
  2. Mojo Stratus
  3. Enable Varnish on Stratus

Enable Varnish on Stratus

When your store is live on Mojo Stratus, you will want to use Varnish for the Magento 2 FPC.  Varnish improves page load time and concurrency to a staggering degree.

Enable Varnish for Magento 2

To enable Varnish on your store, follow these steps:

  1. Log into your Magento 2 admin panel.
  2. Connect to your store admin panel and go to Stores → Settings → Configuration → Advanced → System → Full Page Cache
  3. In the FPC section,c onfigure it as in the screenshot below
  4. Save the configuration
  5. Click Export VCL for Varnish 4
  6. You can discard the downloadable file.
  7. Now log into your Stratus Store Panel
  8. Go to the Varnish area from the left-hand navigation menu, click to expand and select the Info section.
  9. Click Enable to start the Varnish service.
  10. Varnish is now enabled!

Enable Varnish with Turpentine

If you are using Magento 1 and Turpentine, the configuration for Turpentine should use:

  • nginx for the backend host

Then

  1. Log into your Stratus Store Panel
  2. Go to the Varnish area from the left-hand navigation menu, click to expand and select the Info section.
  3. Click Enable to start the Varnish service.
  4. Varnish is now enabled!

Customizing the VCL

By default, enabling Varnish loads a pre-made VCL in the background.  If you have a customized VCL you wish to use, you can add it by following these steps:

  1. Now log into your Stratus Store Panel
  2. Go to the Varnish area from the left-hand navigation menu, click to expand and select the VCL section.
  3. Copy your VCL into the VCL text box
  4. Click Update

Purging Varnish On Stratus

Curl works if you are using SSH, the difference is the Varnish hostname is varnish

Magento 2 users should set their http-cache-host accordingly:

And see Purge the Varnish FPC

Updated on December 20, 2018

Was this article helpful?

Related Articles