v136 · performance

Speculation rules: tag field

This enables developers to add tag field to speculation rules. This optional field can be used to track the source of speculation rules, e.g. to treat them differently at an intermediary server. Any tags associated with a speculation will be sent with the Sec-Speculation-Tags header.

concepts

  1. Speculation Tag

    Speculation rules learn an optional tag field. Sites label their rule sets to attribute prerender hits/misses to specific UX intentions.

  2. Server-side routing

    The receiving end: three tagged rule sets, an edge-worker that branches on Sec-Speculation-Tags — cache hot CDN paths, never cache experiments.

  3. Tag Header Inspector

    Paste any speculation-rules JSON, see the simulated Sec-Speculation-Tags header per URL, plus per-tag counts and an "untagged URL" verdict to validate your CDN logging schema.

  4. Tag Attribution Dashboard

    Build multiple tagged rule sets (CDN, commerce, editorial), see which Sec-Speculation-Tags header value each URL would carry, view per-tag URL counts in a live dashboard, and export the final <script type="speculationrules"> block.

why it shipped

There may be multiple parties on a single referring page which are setting up speculation rules, e.g. CDNs, frameworks, or individual pages. It can be useful for server code to respond differently to speculative navigation requests, depending on which source triggered them.

references