Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Cache review

Security covered No further development 7 sites

This module helps developers understand and debug Drupal's internal and dynamic page caching. It provides demo pages and tools to analyze how caching works for different user types and identify potential caching issues.

Introduction

Cache Review provides tools to help review and analyze how the internal (IPC) and dynamic page cache (DPC) work.
The module also provide several demo pages with cached and non-cached items.
The main goal of Cache Review project is to help developers to learn how cache works for
anonymous and authenticated users.
Also, it should help to review and found possible problems with caching in projects.

Inspired by https://www.drupal.org/project/renderviz and
the article https://weknowinc.com/blog/drupal-8-add-cache-metadata-render-arrays.

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.

Please consider supporting Ukraine in a fight for their freedom and safety of Europe.

Additional about cache

- Cache API: https://www.drupal.org/docs/8/api/cache-api/cache-api !
- Lazy Builders: https://www.hashbangcode.com/article/drupal-9-using-lazy-builders
- IPC: https://www.drupal.org/docs/administering-a-drupal-site/internal-page-cache
- DPC: https://www.drupal.org/docs/8/core/modules/dynamic-page-cache/overview
- Render arrays caching: https://www.drupal.org/docs/drupal-apis/render-api/cacheability-of-rende...
- Auto-placeholdering https://www.drupal.org/docs/drupal-apis/render-api/auto-placeholdering

Requirements

This module requires no modules outside of Drupal core.

Installation

* This module is not for using on Production environment!
* Install and enable this module like any other Drupal modules.

Configuration

In 1.1.x version some configurations were added.
On the page /admin/config/cache-review you can set cache details level on the page:

  • - Framing options
  • -- Disable framing (display Page Cache Status only)
  • To show Cache page status title in bottom and display full information by click.

  • -- Frame all items
  • To analyze all items on the page.

  • -- Frame only lazy built items (L)
  • Only lazy built item will be framing.

  • -- Frame only cached items (C)
  • Only separately cached item will be framing.

  • - Check cache information on admin pages.
  • Select to analyse admin pages.

Use case

Checking cache status
The status of page cache will be displayed at the bottom of each page.
There you can find information about current auto-placeholder-conditions, current time, IPC and DPC status and some additional info about cache on the page.

Playing with cache :)
There is an ability to test how the cache works with different pre-defined settings. Just open any page of your project and research.
And for the first, you can open /cache-review path, open pages with different cache cases and playing with different cache setting
for elements on the pages. There each cache mark (C, L, N) shows cache metadata of element on hover.
You can try to change cache settings (tags, contexts, max-age and lazy builder settings) in cache_review module code.
Just refresh page and see the results. Also the time value on each elements will help to see if item is cached or not.

For instance, on the attached screenshot we can see:
- X-Drupal-Cache is empty, that is mean the current user is authenticated;
- DPC status is UNCACHABLE - so, the response is not from cache;
- IPC will be HIT for anonymouse (of course, if that module enabled);
- On hover each mark in tooltip we can see cache options of the item;
- Element with C mark is cached due to 'keys' options, but it 'user' context bubbled up to top level including whole html.

Documentation

Thanks Philip Norton for such detailed guide and so high mark of this work: https://www.hashbangcode.com/article/drupal-9-debugging-cache-problems-c....
I couldn't have described it better.

Known constraints

Some extra caching tools can influence to the cache_review module results.
Recommends disable big_pipe before using cache_review module.

Ask your assistant about Cache review

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Feb 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.1.0-rc1 Pre-release 9–11 Feb 26, 2024
1.1.x-dev Dev 10–11 Feb 26, 2024