Magento2 Cache – Varnish with Magento 2

cachemagento2varnish

I have Debian 8 with PHP 5.6 installed on my server. I recently installed Magento 2.0.2 and also successfully installed varnish-4.0.2 to use it as a cache on my web server.

I tried to configure varnish-4.0.2 with magento 2 but unfortunately, I'm getting failed every time. The reason why I am saying this because varnish is giving no such performance as compared to I previously experienced with Magento 1.9.2.3. Can anyone please guide me with proper configuration and installation of varnish with magento 2?

Best Answer

Go to Admin panel -> Configuration -> Full Page Cache -> Varnish Configuration: Use following settings:

  • Caching Application: Varnish Caching
  • TTL for public content: 86400
  • Access list: localhost
  • Backend host: IP of Varnish Server
  • Backend port: Public Port of Varnish Server

Hope this will help...