Skip to content
The <head> Observatory

/static/observatorio/en/astro/speculationrules/

Menu

HED-023 · Speculation

<script type="speculationrules">

The only script that runs no code of yours: JSON authorizing the browser to bet.

A <script> tag whose content never runs: it is JSON, read by the browser, authorizing prefetch or prerender of the next navigations — by URL list or by rules matching the page's links, with the impatience dosed by the eagerness field.

prerender builds the whole page in an invisible backstage; when the guess lands, navigation is instant. The caveats: for now it is Chrome-family territory, and a speculated page can fire metrics before the real visit — the spiritual successor of rel="prefetch" wants analytics prepared for the difference.

<script type="speculationrules">
{
  "prefetch": [{ "urls": ["/proxima/"] }]
}
</script>
A script without one line of code — just a declared bet.