Question

How to configure varnish in magento 2?

Selecting Varnish Cache in Stores Configuration is enough?

Was it helpful?

Solution

Selecting Varnish Cache in Stores Configuration is not enough. You also need to install Varnish on your server. You can refer to the following link to install Varnish with Apache on Ubuntu.

https://www.hostingadvice.com/how-to/install-varnish-apache-ubuntu/

After successfully installed Varnish Cache, you can configure it from magento admin configuration STORES > Configuration > ADVANCED > System > Full Page Cache.

OTHER TIPS

Please check with below step :

Log in to the Magento Admin as an administrator.

Click STORES > Configuration > ADVANCED > System > Full Page Cache.

From the Caching Application list, click Varnish Caching.

Enter a value in the TTL for public content field.

Expand Varnish Configuration and enter the following information:

Click Save Config.

I follow this tutorial and successfully setup Varnish on nginx for my Magento 2 website

Reference source for full tutorial: https://magentip.com/install-and-configure-varnish-cache-magento-2/

Step 1: Install Varnish

sudo apt update
sudo apt install varnish

Step 2: Configure webserver for Varnish

Step 3: Configure Magento 2 to work with Varnish

Go to Store > Setting > Configuration > Advanced > System and deselect use system value and choose Varnish as Caching application Step 4: Check if Varnish is working properly curl -IL http://yourwebsite.com/

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top