custom-metrics icon indicating copy to clipboard operation
custom-metrics copied to clipboard

Improve coverage of Speculation Rules custom metrics

Open rviscomi opened this issue 1 year ago • 11 comments

In performance.js we're capturing the speculation rules themselves. This tells us how the links should be prefetched/prerendered, but not which ones actually are.

Add new metadata to the custom metric that captures which requests are actually speculatively loaded. We can look for the Sec-Purpose header and log which requests are prefetched or prerendered.

The custom metric also currently only looks for script tags with the Speculation Rules JSON. But it's also possible to configure the rules via the Speculation-Rules header. The custom metric should check there as well as the script tags.

rviscomi avatar Feb 28 '24 16:02 rviscomi