Magento2 Cache – Built-in Cache vs. Varnish Cache for Full Page Cache

cachefull-page-cachemagento2

What is the difference between the Built-in Cache and Varnish Cache for Full Page Cache?

What options do I have to choose? Why does Magento recommend Varnish?

enter image description here

Best Answer

from https://www.section.io/blog/magento-performance-magento-varnish-cache/

"One common mistake when using Magento 2 is believing that Magento 2’s built in “Full Page Cache” feature is sufficient for performance. The Full Page Cache mode is labelled by Magento as to be used in development mode, as developers are not able to see what is being cached and what is not being cached with this setting. In production, it is strongly recommended all Magento 2 stores use Varnish Cache for optimal performance."

  • Magento recommends Varnish as the full page cache for a production site - the built in cache should be used for development.

  • Install varnish and configure Magento with the hostname or ip address and port of your varnish server

  • download a vcl configuration file generated by Magento to use with the varnish server.

  • make sure you add the external cache to the Magento configuration

    php bin/magento setup:config:set --http-cache-hosts=varnishhost