How To Configure Full-Page Cache In Magento 2

Magento provides a solution that uses full page caching to improve website performance. Quickly display category, products, CMS pages, improve response time, reduce server load. The special thing is that you can easily enable it in the Admin Panel. In this post, I will guide you How To Configure Full-Page Cache In Magento 2.

Full-Page Cache

With full-page caching, category, products, CMS pages will be rendered faster, improving response time and reducing the load on the server. Pages can be read directly from the cache. Without caching, each page may need to run blocks of code and retrieve information from the database.

Magento provides two options:

  • Built-in Cache.
  • Varnish Caching.
Note: Magento recommends that Varnish Cache be used only in a production environment.

Cached content can be used to handle requests from visitor types. The pages that are visible to the customer will be different from the casual visitor. It is divided into 3 types:

  • Non-sessioned.
  • Sessioned.
  • Customer.

Steps To Configure Full-Page Cache In Magento 2

Step 1: Login to Admin Panel.

Step 2: Choose STORES -> Settings -> Configuration.

Step 3: Select ADVANCED -> System in the left panel.

Choose System in Advanced section on the left panel

Step 4: Expand the Full Page Cache section.

Expand the Full Page Cache section.

Step 5: In the Caching Application field, select one of the following:

  • Built-in Cache.
  • Varnish Caching.
Select one of the Caching Application

If using Varnish, complete the Varnish Configuration section as follows:

Complete the Varnish Configuration section
  • Access list – Enter the IP addresses that can purge the Varnish configuration to generate a config file. Separate multiple entries with a comma. The default value is localhost.
  • Backend host – Enter the IP address of the backend host that generates config files. The default value is localhost.
  • Backend port – Identify the backend port that is used to generate config files. The default value is: 8080.
  • To export the configuration as a varnish.vcl file, click the button for the version of Varnish that you use.
    • Export VCL for Varnish 4
    • Export VCL for Varnish 5
    • Export VCL for Varnish 6

Step 6: To set the timeout for the page cache, enter the TTL for public content. (The default value is 86400)

Set the timeout for the page cache

Step 7: Click to Save Config, and refresh cache.

Click to Save Config

You can read more useful articles like How To Clear Magento 2 Cache.

Follow us for the more helpful posts!

We hope this is a useful post for you.

Thank you for reading!

5 1 vote
Article Rating

Aaron LX

Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.

Leave a Reply or put your Question here

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x