Skip to content

Cache observer

Cache event capture, the raw report, exports, deletion, and settings are provided by the native_observability_cache_observer submodule. It is part of the RAW install tier; enable it with drush no:preset:raw, or directly with drush en native_observability_cache_observer -y.

Cache tab of the dashboard, showing cache health and efficiency
The Cache tab reads the records this module writes: backend per cache layer, activity trend, and an efficiency score broken down by cacheable responses, HTTP cache activity, invalidation pressure and dynamic cache effectiveness.

Routes

Route Path Permission
native_observability_cache_observer.report /admin/reports/native-observability/cache-observer access native observability cache observer
native_observability_cache_observer.view /admin/reports/native-observability/cache-observer/{id} access native observability cache observer
native_observability_cache_observer.export /admin/reports/native-observability/cache-observer/{id}/export access native observability cache observer
native_observability_cache_observer.export_filtered /admin/reports/native-observability/cache-observer/export/filtered access native observability cache observer
native_observability_cache_observer.delete_selected /admin/reports/native-observability/cache-observer/delete-selected administer native observability cache observer
native_observability_cache_observer.delete_scope /admin/reports/native-observability/cache-observer/delete-scope administer native observability cache observer
native_observability_cache_observer.delete_all /admin/reports/native-observability/cache-observer/delete-all administer native observability cache observer
native_observability_cache_observer.delete_filtered /admin/reports/native-observability/cache-observer/delete-filtered administer native observability cache observer
native_observability_cache_observer.settings /admin/config/development/native-observability/settings/cache-observer administer native observability cache observer

Report

Open /admin/reports/native-observability/cache-observer. CacheObserverListController::list() renders a filterable, paginated table (event/layer, status, method, route/path, request ID, cacheability summary, created date) sourced from CacheObserverStorage. Filters read from the query string: search, event_type, status, method (the filtered export and deletion forms additionally support cache_layer, route_name, path, request_id, has_request_id, and uncacheable_only).

If CacheObserverEnvironmentInspector detects a development/debug environment (for example page cache or dynamic page cache disabled), the report shows a warning banner: in that condition, cache headers, page cache hits, dynamic cache hits, and other observer signals may be partial or missing.

Each row links to the single event view, and links to the correlated trace (via native_observability.trace_view_by_request_id) when the row's request_id matches a stored trace.

A row recorded for an Internal Page Cache HIT is the one case where that link is expected to be absent. A hit is served by the page cache middleware before the HTTP kernel runs, so no trace row is ever written for it. The observer still assigns the request a correlation ID and records it, both on the row and on the X-Native-Observability-Request-Id response header, so a hit remains identifiable and countable. That ID resolves to this cache event and to nothing in native_observability_trace, which is the accurate answer for a request Drupal never handled.

Single event view

Follow a row's ID link, or open /admin/reports/native-observability/cache-observer/{id} directly, for full details on one captured cache event.

Exports

Single event

/admin/reports/native-observability/cache-observer/{id}/export downloads the raw stored record as cache_observer_event_<id>.json.

Filtered set

/admin/reports/native-observability/cache-observer/export/filtered downloads up to 5000 rows matching the current filter set as cache_observer_filtered_export.json. The payload includes a meta block (export timestamp, row count, applied filters) alongside the rows array.

Deletion scopes

The submodule exposes four distinct deletion actions. They are not interchangeable: each targets a different subset of stored records.

Scope Route What it deletes
Selected delete_selected Only the record IDs passed in the ids query parameter (comma-separated), populated by row selection in the report UI.
Scope (table) delete_scope Every record in one partition, chosen by the scope query parameter: route_bound (events captured inside a resolved Drupal route) or orphan (CLI, cron, install, or middleware events with no resolved route). The other partition is left untouched.
All delete_all Every stored cache observer record, regardless of filters or partition.
Filtered delete_filtered Only the records matching the filter set currently applied on the report page (up to 5000 rows per submission).
flowchart TD
    A[Cache observer records] --> B[Selected: chosen row IDs only]
    A --> C["Scope: route_bound partition"]
    A --> D["Scope: orphan partition"]
    A --> E[Filtered: rows matching current filters]
    A --> F[All: every record]

All four deletion forms are confirmation forms and note explicitly that they remove stored observability records only; none of them clears Drupal's runtime caches.

Settings

/admin/config/development/native-observability/settings/cache-observer configures capture behavior and retention. See Cache observer settings for the full list of keys and their default values.