Skip to content

Conversation

@dermatz
Copy link
Collaborator

@dermatz dermatz commented Feb 9, 2026

This pull request enhances the Magento block inspector hints system by adding detailed performance and cache metrics to frontend block metadata. It introduces a new BlockCacheCollector service to gather cache-related information and render timings, and integrates these metrics into the inspector hints for improved debugging and profiling.

CSS refactoring
Add Styles to inspector.css

Inspector Hints Performance & Cache Metrics Integration

Inspector hints decorator improvements:

  • The InspectorHints class now measures the render time of each block, calculates metrics, and passes them to the inspector attributes for frontend debugging. This includes render duration in milliseconds and timestamps. [1] [2]
  • The injectInspectorAttributes method is updated to accept and include performance and cache metrics in the metadata JSON output for each block. [1] [2] [3]

New cache metrics collector service:

  • Introduced BlockCacheCollector, a new service that safely extracts cache configuration (lifetime, key, tags, cacheability) and determines if the page is cacheable. It also formats both performance and cache metrics for frontend consumption, with strict type safety.
  • The InspectorHints constructor is updated to accept a BlockCacheCollector dependency, enabling it to gather cache metrics for each block. [1] [2]

Dependency injection configuration:

  • Updated di.xml to register the new BlockCacheCollector service and inject it into the InspectorHints decorator, ensuring the new metrics are available in the frontend inspector hints.

@dermatz dermatz requested a review from Morgy93 February 9, 2026 23:51
@dermatz dermatz changed the title feat: add cache and webvitals tabs to inspector and improve overlay ux feat: add cache and webvitals tabs to inspector and improve ux with dragable overlay Feb 10, 2026
@dermatz dermatz merged commit eea755d into main Feb 10, 2026
14 of 15 checks passed
@dermatz dermatz deleted the feature/inspector-performance-tabs branch February 10, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants