On this page
A browser may request a link destination before a user clicks it when a page supplies Speculation Rules. Before comparing navigation performance across browsers, check which destinations are eligible, what the browser actually requests, and whether those requests are safe.
This checklist uses an isolated, non-production site to examine browser speculation rules link destinations. The current support matrix, browser documentation, and specification could not be verified for this article. Treat the matrix below as a test plan, not a statement of current browser behavior; complete the documentation checks before publishing a compatibility review. The example was not executed here.
Key Takeaways
- Test same-origin, cross-origin, excluded, and redirected destinations separately. A rule makes a destination a candidate; it does not guarantee a speculative request.
- Record browser versions, settings, rule syntax, request evidence, and navigation outcomes. Do not interpret an absent request as a compatibility failure without further investigation.
- Correlate browser network records with controlled server logs to distinguish a speculative request from a click-triggered navigation.
- Keep personalized, authenticated, and side-effecting endpoints out of speculative candidates unless their behavior has been explicitly reviewed and made safe.
Prepare the lab
Use a source page and destination endpoints you control in a non-production environment. Create a second controlled origin for the cross-origin cases. The examples use https://other.example as a fictional address; replace it with your lab's real second origin before testing.
On the source origin, create these routes:
/speculation-lab/target: a public, static HTML page with no personalized data or side effects./speculation-lab/excluded: another safe HTML page, intentionally omitted from the example rule./speculation-lab/redirect: a redirect to a safe lab destination. Run separate cases for a same-origin destination and the controlled second origin.
On the second origin, create /speculation-lab/target as a similarly safe page. Ensure the server logs can identify the requested path, time, response status, and redirect target without recording credentials or personal data. If you use additional request headers for diagnosis, review the logging policy first.
Make the lab pages available only to your QA team as appropriate, but avoid introducing authentication redirects into the baseline cases. Disable unrelated speculation rules, extensions, and application features that could initiate requests. Record any service worker, cache, proxy, or network configuration that might affect the results.
Verify support before running the review
For every browser and version in scope, consult its official documentation and the relevant Speculation Rules specification. Record the date checked, supported rule types and syntax, prerequisites, observable request indicators, known restrictions, and relevant cross-origin or redirect behavior. Check prefetch and prerender separately; support for one should not be assumed to establish support for the other.
If the documentation or specification cannot be checked, mark the review verification pending rather than reporting a definitive support matrix. Browser policies and implementation details can change, so repeat the check when the versions under review change.
Advertisement
Configure a small prefetch experiment
Add ordinary links to the lab source page, then add a list-based rule. The list intentionally omits the excluded route. The following is an illustrative HTML fragment, not a complete application:
<a href="/speculation-lab/target">Same-origin target</a>
<a href="https://other.example/speculation-lab/target">Cross-origin target</a>
<a href="/speculation-lab/excluded">Excluded target</a>
<a href="/speculation-lab/redirect">Redirect target</a>
<script type="speculationrules">
{
"prefetch": [
{
"source": "list",
"urls": [
"/speculation-lab/target",
"https://other.example/speculation-lab/target",
"/speculation-lab/redirect"
]
}
]
}
</script>
Replace both occurrences of https://other.example with the same controlled origin. Confirm that the selected browser and version support the syntax before interpreting results. This list does not exercise document-rule predicates: if your application uses document rules or exclusions based on link properties, repeat the matrix with the actual rules and representative links.
Run prefetch and prerender as separate experiments if both are in scope. Use rule syntax verified for each browser and version. A prerender can involve more page activity than a single initial request, so inspect its subrequests and effects as well as the destination request; only use lab pages designed for that test.
Destination test matrix
For each row, run a fresh pre-click observation, then a separate click or navigation observation. Repeat for each browser/version and each rule type in scope. Do not assume that all candidates will be fetched or that a later navigation will reuse a speculative result.
| Case | Setup | What to record |
|---|---|---|
| Same-origin | Include /speculation-lab/target in the rule. | Whether a request appears before interaction; its initiator and headers; and what happens after a click. |
| Cross-origin | Include the controlled second-origin target. | Whether either origin records a request, any browser-reported restriction, and whether the later navigation uses or replaces the earlier work. Record credential behavior only as observed. |
| Excluded | Provide a link to /speculation-lab/excluded, but omit it from the list and disable other rules. | Whether it is requested before interaction. If it is, investigate other initiators or rules before attributing it to the test. Check that a deliberate click still navigates as expected. |
| Same-origin redirect | List /speculation-lab/redirect and configure it to redirect to the local safe target. | Requests and response statuses for each hop, timing relative to the click, and whether the navigation triggers additional requests. |
| Cross-origin redirect | Use the same listed redirect route, configured to redirect to the controlled second origin. | Which hops occur before and after interaction, restrictions or errors, and whether the navigation succeeds. Do not assume behavior matches a direct cross-origin candidate. |
Also test a candidate that is linked but not included under the actual application rule conditions, and test any redirect chain the application genuinely uses. For each result, note the exact rule, browser version, destination, settings, timestamps, and whether the result is reproducible. Record an absent request as not observed, along with the circumstances, rather than automatically calling it unsupported.
Advertisement
Inspect speculative requests and navigation
- Open the browser's developer tools on the lab source page. Enable network-log preservation across navigation if the browser offers it, and clear existing entries.
- Load the source page without clicking or otherwise interacting with the test links. Allow the browser time to act, then inspect requests to both lab origins. Some browsers expose speculation-specific diagnostics; use them where documented for the version being tested.
- For a candidate request, record its time, initiator, destination, response, and any browser-exposed purpose or fetch metadata. A header such as
Sec-Purposemay help identify intent when present, but do not rely on one header alone or assume every browser exposes the same signals. - Correlate those records with the controlled servers' logs. For redirects, follow every visible hop. A request before a deliberate navigation, attributed by the browser to speculation, is stronger evidence than timing alone.
- Click the link and inspect the navigation and any subsequent requests. Depending on the browser and circumstances, a navigation may generate a new request or use previously obtained work. A missing second server request alone does not prove reuse; consult the browser's diagnostics and document the evidence.
- Repeat with a fresh session or appropriately cleared state, noting cache and service-worker conditions. Compare with a run where the rule is removed to help identify unrelated requests.
If the browser shows no speculative request, check the rule's validity and support, candidate eligibility, browser settings, network conditions, and application interference. Browsers may choose not to speculate; a single negative observation does not identify the cause.
Safeguard sensitive and side-effecting routes
Use an explicit allowlist of reviewed, safe destinations for the experiment. Exclude account pages, personalized content, sign-in and sign-out flows, checkout routes, and endpoints that change state until the application team has assessed their behavior. Review redirects too: an apparently safe candidate can lead to a sensitive route.
A request can reach a server even if the user never clicks, and a prerendered page can initiate additional activity. Do not depend on the absence of a click as an authorization boundary. Enforce authentication and authorization on the server, avoid state changes on ordinary retrieval requests, and make operations that change state require appropriate protections. Check analytics and audit logging so speculative activity is not mistaken for a confirmed user visit or action.
Before enabling broader rules, review credential handling, cache behavior, privacy implications, rate limits, and the behavior of third-party resources. Use synthetic accounts and data if an authenticated flow must be evaluated, and obtain approval for any cross-origin testing.
Common Mistakes
- Treating a rule as a guarantee. An eligible destination may not be requested, and speculative work may not be reused.
- Testing only the initial URL. Redirects, subrequests, and the final destination can introduce different restrictions or risks.
- Counting every early request as speculation. Application code, extensions, caches, and other rules can produce similar network activity.
- Calling an omitted list entry a universal exclusion. Another rule or application feature could still request it.
- Using production or real customer sessions for initial tests. Unexpected requests can affect privacy, analytics, and application state.
Best Practices
- Keep a versioned record of the rules, browser versions, documentation checks, lab configuration, and observed evidence.
- Test prefetch and prerender independently, including the actual rule style used by the application.
- Start with safe, explicit candidates and expand only after reviewing destinations and redirect chains.
- Repeat tests after browser, rule, server, or deployment changes that could affect navigation behavior.
Conclusion
A destination matrix separates rule eligibility from actual browser behavior and makes unexpected requests easier to investigate. Complete the official documentation and specification review before turning lab observations into a browser compatibility claim.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.