Full Page Caching in Adobe Commerce

What is Full Page Cache (FPC) in Adobe Commerce?

Full Page Cache (FPC) is a performance optimization mechanism that stores the fully rendered HTML output of a page. When a user requests the same page again, the cached HTML is returned instead of executing PHP code and database queries.

This significantly reduces server load and improves page load time for high-traffic ecommerce stores built on Adobe Commerce.

Why is Full Page Cache Important?

Full Page Cache is essential for scaling ecommerce platforms because it reduces application processing.

  • Reduces PHP execution.
  • Minimizes database queries.
  • Improves Time To First Byte (TTFB).
  • Allows stores to handle high concurrent traffic.

What Types of Content are Cached?

FPC caches only public content that is the same for all users.

  • CMS pages
  • Category pages
  • Product detail pages
  • Homepage content

What Content is Not Cached?

Customer-specific or dynamic content is not cached in Full Page Cache.

  • Shopping cart items
  • Customer name in header
  • Wishlist count
  • Customer messages

Adobe Commerce loads this content dynamically using JavaScript private content sections.

What is Private Content?

Private content refers to customer-specific data that cannot be cached globally. Adobe Commerce loads this content asynchronously using JavaScript after the page loads.

This approach allows the page itself to remain cached while dynamic sections update independently.

What is Hole Punching?

Hole punching is a technique used to insert dynamic blocks into an otherwise cached page.

It allows certain parts of a page to remain dynamic while the rest of the page is served from the cache.

  • Mini cart
  • Customer welcome message
  • Wishlist counter

What is the Difference Between Built-in Cache and Varnish Cache?

Adobe Commerce supports two types of Full Page Cache implementations.

  • Built-in Cache: Managed within the application.
  • Varnish Cache: An external reverse proxy cache recommended for production.

Varnish provides significantly better performance and scalability.

What are Cache Tags?

Cache tags are identifiers associated with cached content. They allow Magento to invalidate only the affected cached pages when data changes.

For example, when a product is updated, all cached pages associated with that product tag are cleared.

What Happens When a Product is Updated?

When a product is saved or updated in the admin panel, Adobe Commerce invalidates cache entries that contain that product.

  • Product detail page cache is cleared.
  • Category pages containing that product are invalidated.
  • Search result pages may also be refreshed.

What is the X-Magento-Cache-Debug Header?

The X-Magento-Cache-Debug header helps developers determine if a page is served from cache.

  • HIT → Page served from cache.
  • MISS → Cache entry not found.
  • BYPASS → Cache skipped.

What is cacheable="false" in Layout XML?

In layout XML, developers can mark blocks as non-cacheable using the attribute cacheable="false".

If any block on a page is marked as non-cacheable, the entire page becomes non-cacheable and is excluded from Full Page Cache.

This should be used carefully to avoid performance issues.

What is Cache Context?

Cache context determines how cached pages vary based on specific conditions.

  • Store view
  • Currency
  • Customer group
  • Theme

Different contexts generate different cache versions of the same page.

How Does Adobe Commerce Invalidate Varnish Cache?

Adobe Commerce sends HTTP PURGE requests to the Varnish server when content changes.

The Varnish server removes cached entries associated with the provided cache tags.

What is Cache TTL?

TTL (Time To Live) defines how long cached content remains valid before it expires.

After the TTL expires, the next request regenerates the page and stores it again in the cache.

Which Pages Are Typically Excluded from Full Page Cache?

Some pages cannot be cached due to personalized data.

  • Checkout page
  • Shopping cart page
  • Customer account dashboard
  • Admin panel pages

How does Adobe Commerce generate a unique cache identifier for a page?

Adobe Commerce generates a unique cache identifier (cache key) based on multiple context variables that affect page rendering.

This ensures that different variations of the same page are cached separately.

  • Store view
  • Currency
  • Customer group
  • Design theme
  • Device type (optional)

This mechanism prevents serving incorrect cached content to users with different contexts.

What is the role of the X-Magento-Tags HTTP header in Full Page Cache?

The X-Magento-Tags header contains cache tags associated with the content of the page.

These tags allow Adobe Commerce to invalidate specific cache entries instead of clearing the entire cache.

For example, if a product is updated, Magento invalidates cache entries that include that product’s cache tag.

How does Adobe Commerce handle cache invalidation when catalog data changes?

When catalog data such as products or categories is updated, Adobe Commerce triggers cache invalidation using cache tags.

The system identifies all cached pages associated with the updated entity and removes them from the cache.

On the next request, the page is regenerated and stored again in the cache.

What is Edge Side Includes (ESI) and how is it used in Varnish caching?

Edge Side Includes (ESI) is a mechanism that allows dynamic fragments to be included inside cached pages.

In Adobe Commerce, ESI is used with Varnish to load dynamic blocks while keeping the main page cached.

This technique allows partial page updates without invalidating the entire cache.

What is the purpose of the X-Magento-Vary header?

The X-Magento-Vary header helps ensure that cached pages are served correctly based on specific contexts.

This header instructs the caching system to vary cached responses based on factors such as:

  • Store view
  • Currency
  • Customer group

This prevents users from receiving cached pages intended for other contexts.

What is the cache warming process in Adobe Commerce?

Cache warming is the process of preloading important pages into the Full Page Cache before real users access them.

This ensures that the first visitor does not experience slow page generation.

  • Homepage
  • Category pages
  • Popular product pages

Cache warming is often implemented using automated scripts or external crawling tools.

How does the request flow work when Varnish Full Page Cache is enabled?

When Varnish is enabled, the request flow follows a reverse proxy architecture.

  1. User sends request to the server.
  2. Request reaches Varnish.
  3. If cached content exists, Varnish returns it immediately.
  4. If no cached entry exists, the request is forwarded to Adobe Commerce.
  5. The generated response is cached and returned to the user.

What is Grace Mode in Varnish and why is it important?

Grace Mode allows Varnish to serve stale cached content while refreshing the cache in the background.

This prevents a situation where many requests simultaneously hit the backend when a cache entry expires.

Grace Mode helps maintain high availability during heavy traffic spikes.

What is Cache Stampede and how can it be prevented?

Cache stampede occurs when multiple requests attempt to regenerate an expired cache entry simultaneously.

This can overload the backend server.

Adobe Commerce prevents this through:

  • Grace Mode in Varnish
  • Request coalescing
  • Proper TTL configuration

How can developers debug Full Page Cache issues?

Developers can inspect HTTP response headers to understand cache behavior.

  • X-Magento-Cache-Debug
  • X-Magento-Tags
  • X-Magento-Vary

These headers indicate whether a page was served from cache and what tags are associated with the cached entry.

What happens if a layout contains a non-cacheable block?

If any block in the page layout is marked with cacheable="false", the entire page becomes non-cacheable.

This forces the application to generate the page dynamically for every request.

Developers should avoid this unless absolutely necessary to maintain optimal performance.

How do customer-data sections work with Full Page Cache?

Customer-data sections allow Adobe Commerce to load private content dynamically using JavaScript.

The page itself is served from the Full Page Cache, while private data is fetched separately via AJAX requests.

This ensures that user-specific information remains accurate without sacrificing caching performance.