v138 · performance

Speculation rules: target_hint field

This extends speculation rules syntax to allow developers to specify the target_hint field.

concepts

  1. target_hint

    Speculation rules can hint at the navigation target (e.g. _blank). Lets the browser pre-allocate the right top-level context for the eventual click.

  2. Popup prewarm

    The exact wasted-prerender case the field solves: same-tab vs middle-click. Pick a hint, click both targets, watch which side wins the cache.

  3. Rules builder

    Interactive editor for the full speculation rules JSON schema — action, eagerness, target_hint, referrer_policy, urls vs href_matches — with a compatibility matrix and a live <script type="speculationrules"> injection button.

  4. Hint analytics

    Dashboard tracking 12 simulated navigations across three rule sets (_self, _blank, no hint). Shows which navigations get cache hits vs misses based on whether the hint matched the actual navigation target, and calculates the prerender waste rate per hint strategy.

why it shipped

In the Chromium implementation, we have accidentally created an architecture where it is hard to prerender a page without knowing what target window (or tab) it is going to be in. Currently we are always assuming that the prerender will be navigated to in the current window. The target_hint allows us to know a target window before starting prerendering.

references