Magento Open Source 2.3.x

Full-Page Cache

Magento Open Source uses full-page caching on the server to quickly display categoryA set of products that share particular characteristics or attributes., product, and CMSContent Management System: A software system that is used to create, edit, and maintain content on a website. pages. Full-page caching improves response time and reduces the load on the server. Without caching, each page might need to run blocks of code and retrieve information from the database. However, with full-page caching enabled, a fully-generated page can be read directly from the cache.

We recommend Varnish to be used only in a production environment.

Cached content can be used to process the requests from similar types of visits. As a result, pages shown to a casual visitor might differ from those shown to a customer. For the purposes of caching, each visit is one of three types:

  • Non-sessioned

    During a non-sessioned visit, a shopper views pages, but does not interact with the store. The system caches the content of each page viewed, and serves them to other non-sessioned shoppers.

    Sessioned

    During a sessioned visit, shoppers who interact with the store—through activities such as comparing products or adding products to the shopping cart—are assigned a session ID. Cached pages that are generated during the session are used only by that shopper during the session.

    Customer

    Customer sessions are created for those who have registered for an account with your store and shop while logged in to their accounts. During the session, customers can be presented with special offers, promotions, and prices that are based on the customer group to which they are assigned.

For technical information, see Configure and Use Varnish and Use Redis for the Magento page and default cache in the developer documentation.

To configure the full-page cache:

1. On the Admin sidebar, tap Stores. Then under Settings, choose Configuration.
2. In the panel on the left under Advanced, choose System.
3. Expand the Full Page Cache section.
4. Set Caching Application to one of the following:
  • Built-in Application
  • Varnish Caching
5. To set the time-out for the page cache, enter the TTL for public content. (The default value is 86400)
6. If using Varnish, complete the Varnish Configuration section as follows:
a. In the Access list field, 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.”
b. In the Backend host field, enter the IP address of the backend host that generates config files. The default value is “localhost.”
c. In the Backend port field, identify the backend port that is used to generate config files. The default value is: “8080.”
d. To export the configuration as a varnish.vcl file, tap the button for the version of Varnish that you use.
  • Export VCL for Varnish 3
  • Export VCL for Varnish 4
7. When complete, tap  Save Config .