Log in
Use cases
Log in

Understand the basics of pagecaching

A Website’s speed is essential for it to rank well on search engine results pages (SERP), attract new clients, and generally increase conversion rates. Additionally, it is also extremely important to your consumers’ overall experience. Although a website’s speed has a significant impact on many elements, a number of reasons cause it to load slowly and demand constant attention.

The default Magento 2 full-page cache is the one we’re going to talk about today. In this article, you will discover all there is to know about Page Caching on Magento 2. You may enhance your website’s performance, with the free caching solution that Magento uses.

What does Page Caching on Magento 2 do?

Due to the quick loading of CMS, product, and catalog pages, Page Caching on Magento 2 is a free built-in caching solution that enables you to minimize server load time and enhance response time.

As we just discussed, entire page caching on Magento 2 is enabled by default because of the PHP reverse proxy, which acts as a middleman between your installation and the users of your website. You can use less bandwidth and your server loads faster.

Magento Full Page Cache: How Does It Work?

When you enter a website page, the server receives a request to create the page’s content, which requires some time. The system must renew the page each time a user enters a page because it doesn’t store the most recent version of the page.

To avoid this, Magento maintains a copy of the page in the system after the first page loads, along with the cache key. By doing this, when you return to the page later, the content that matches the identity of the first cached copy is generated much more quickly. 

cFBBEdosz8k COgpLfAjGNNin6MtIR A OCymaQw3X7MctglogAU3zukwHWe5rac0O1oJ6f2yijltolOen80wQ3NOJKqUNNDWj8zewTM1Po7NE9ENXBu5 hvfXe10N7D10Jr5CpnId3AcCckDMwZMMc

It is the server-side functionality of page caching on Magento 2. On the customer side, things are a little different.

Users use a browser on their laptop or PC to access your website. The data is consequently processed on their equipment. Magento offers the page-cache.js file to process the cache on users’ devices and synchronize them with the server in order to cache the content on the client side.

But there’s more to it than that.

Full page cache session types

Customers use your website for a variety of purposes, including browsing new products casually, comparing them, and making wish lists for future purchases. The same content cannot, therefore, be cached for all of them. To cache content for various visitor sessions in this instance, Magento outlined different session kinds.

For various sorts of requests used for caching, there are 3 main types of visits:

  1. Non-sessioned – visitors that merely skim the website pages without engaging with them. As a result, the system saves the page content in a cache and shows it to other non-session visitors for each page they see.
  2. Sessioned – website users go around the sites and do various actions like adding items to their shopping carts or contrasting them. Each session has a unique session ID, and only the visitors who are currently logged into that session can see any cached pages.
  3. Customer – Users who are logged in and who browse and shop on your website complete customer sessions. Additionally, they have discounts, promotions, and special deals that are tailored just for their clientele.

Cachable and Uncachable Pages

Page caching on Magento 2 depends on whether or not the page is cacheable. 

All of the pages on your website can be cached by default because Magento 2’s full-page cache supports all of them. These are the product, category, and other catalog pages as well as the CMS. On the other hand, uncacheable pages are those that generate private data with each page load, such as checkout and customer account pages.

Simply add cacheable=”false” to the page block to make it non-cacheable, as seen in the following example:


Private vs Public Content

Different content types, such as public and private, are defined based on caching techniques and the sorts of pages cached.

Public content is static information with a long life span that is kept on the server and made accessible to many users (contact us, about us, category listing, product page, etc.).

Private content is dynamic content with a limited lifespan that is only accessible to certain users and is saved on the client side (customer data, personalized sales offers, shopping carts, wishlists, etc.).

ykv D uj2ox0iAG5UPj738NmmlYPD579eqfASLJAgAHVJTJIoC9sPir5PiE INilLsyMKb0sCnLXN 5cnhy PKjxaU9A0woS3 D q9ePucLT7q36szSdCTOdzKcLnC2LlDbyAi9l7c0EwMfcU45ybBY

By turning on full-page caching on Magento 2, you ensure that your clients receive pertinent content as quickly as possible.

Let’s explore our options to configure it in Magento 2.

Configuring full page caching on Magento 2

  1. Select Stores > Configuration > Advanced > System and then click Full Page Cache.
  2. Choose either VARNISH CACHING or the built-in application as your caching option.
  3. To specify the page cache timeout, set the TTL for public content. By default, it is set to 86400, which corresponds to about 24 hours. Data on the page is updated once the timer has run out.
5Fcule70nkMiKnr6ZLYTps2aUD5s1dnX1B6H8SF5M5oW8TUyPxGzgq1uKQ RcfGWeVlS3zJ12e rNOyfk5tHCpeoEQtTXS0BBV6st8kk NuWzg MjkxjSTk3 gnOH71TiQu9WJ1TBbRyiWJ5IA6ghA

You must complete additional fields if you plan to use Varnish for your application.

Configuring Varnish in Magento 2

1. In the Assess list field, type IP addresses that Varnish can use to prevent from the creation of config files.

2. Set the backend host that creates configuration files in the Backend host field.

3. Set the Backend port for the creation of configuration files.

4. To create configuration files, specify the Grace period in seconds.

5. For your varnish version, export configuration.

hXD RrsMLpoJr8zwmN939uu6QJGk6FX2G57xQAUOWHAWM23bH2QEP5gYpu0T

Full page cache monitoring for Magento 2

When speed suddenly drops, it may occasionally be because the whole page caching on Magento 2 is disabled. It impairs not only the operation of your store but also the backend workflow. Activate the disabled cache notification to receive alerts when the full page cache has to be enabled.


The Cache Warmer, which will replicate user activity and warm the cache on your shop, is the alternative. No complicated configuration is needed in the interim. The whole page caching on Magento 2 will be taken care of if only the fundamentals are configured.

We have compiled a list of the top Magento 2 functions and shortcuts for you to nerd out on. Check them out to get the best solutions, easy-to-follow tips and tricks, and detailed guidelines to utilize your online Magento store to the fullest. 

Get help from a human
Submit a request for help with your Braintree sandbox or production account.
Get Help
Select location and language

Contact Our Sales Team

Learn more about our products, features, and pricing options.
By submitting this form, you agree to receive promotional messages from Shopify about its products and services. You can unsubscribe at any time by clicking on the link at the bottom of our emails.
Use cases
Log in
Start a free trial