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)
- -- Frame all items
- -- Frame only lazy built items (L)
- -- Frame only cached items (C)
- - Check cache information on admin pages.
To show Cache page status title in bottom and display full information by click.
To analyze all items on the page.
Only lazy built item will be framing.
Only separately cached item will be framing.
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.
Project information
Seeking new maintainer
The current maintainers are looking for new people to take ownership.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Developer tools
10 sites report using this module
- Created by osab on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.


