← All modules

Magento 2 module

Cache Usage

Shows how well the full page cache and block cache work: records cache hits and render times per page and block, with admin reports and on-page markers.

A slow store is often caused by pages or page parts that are not cached, although they could be. Cache Usage makes this visible. It records for every page request whether the page was cacheable and actually served from the full page cache, and for every block on a page whether it was cached, could have been cached or cannot be cached, together with the time it took to render. The results can be analysed in the admin or shown directly on the storefront while you test.

Features

  • Infrangible > Cache Usage > Full Page Cache lists the recorded page requests with route, path, query, “Cacheable”, “Cached”, duration and date. Records can be grouped, for example by path, to see average durations.
  • Infrangible > Cache Usage > Block Cache lists the rendered blocks of pages that were not served from the full page cache, with their layout name, template, cache status and render time.
  • Optional summary below each storefront page with the cache status of the page and lists of cached, uncached and uncacheable blocks.
  • Optional coloured borders around blocks on the storefront: red for uncacheable, green for cached, yellow for uncached and grey for default blocks, each with an info icon that shows the block details on hover.
  • Optional display of the layout handles and of the complete layout structure of a page.
  • Clear Cache Usage removes all recorded data, Reduce Cache Usage removes data older than 30 days. Both can be started from the admin menu; Reduce also runs automatically every hour.

Configuration

Under Stores > Configuration > Infrangible Solutions > Cache Usage you switch on data collection separately for the full page cache and the block cache, and choose which summaries, block markers and layout information are displayed. All options can be set per website and store view. The schedule of the automatic reduction is set under Stores > Configuration > Tasks > Reduce Cache Usage.

Good to know

The on-page summaries, markers and layout information are shown to every visitor of the configured store view, so enable them only on a test or staging store, or only for a short time. Data collection adds database writes to every page request. The background jobs are run by “Task”. For stores with the Hyvä theme, install “Cache Usage Hyvä Theme” as well.

Installation

Install the module with Composer in your Magento root directory:

composer require infrangible/m2-cache-usage

Then enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.

Using the Hyvä theme? Also install the companion module Cache Usage Hyvä Theme:

composer require infrangible/m2-cache-usage-hyva