Ir al contenido principal

Software, apps, sitios web, redes y automatización con IA

Perspectivas tecnológicas

Instant Page Loads in 2026: Why Browsers Can Now Render Your Next Page Before the Click, What the Speculation Rules API’s Prefetch and Prerender Actually Do, and How to Turn It On Without Skewing Analytics or Overloading Your Server

Instant Page Loads in 2026: Why Browsers Can Now Render Your Next Page Before the Click, What the Speculation Rules API’s Prefetch and Prerender Actually Do, and How to Turn It On Without Skewing Analytics or Overloading Your Server

  • Equipo de Internet Pros
  • November 14, 2026
  • Diseño Web

Este artículo está disponible solo en inglés.

Click a link on most websites and you wait. The browser asks the server for the page, downloads it, builds it and paints it, and only then do you see anything. A few hundred milliseconds on a good day, a few seconds on a phone with weak signal. The Speculation Rules API removes most of that wait by letting the browser fetch, or even fully render, the next page while the visitor is still deciding whether to click. Done well, pages appear the moment the link is clicked. Done carelessly, you double your server traffic and count visits that never happened.

The Old Way: Hints the Browser Mostly Ignored

Developers have tried to preload pages for over a decade. <link rel="prefetch"> asked the browser to download a file at low priority, and Chrome’s old <link rel="prerender"> promised to render a whole page in the background. In practice prefetch was unreliable across browsers, and Chrome quietly downgraded the old prerender hint to a lightweight “NoState Prefetch” years ago. Sites that wanted instant navigation turned to JavaScript libraries that prefetched links on hover, which worked but added code and could not truly prerender.

Speculation rules replace those hints with a small JSON block that tells the browser which URLs it may load early, how aggressively, and whether to prefetch or prerender them. The browser stays in charge: it can skip a speculation to save battery or data, and it caps how many run at once.

Prefetch vs Prerender: Two Very Different Bets

Prefetch Prerender
What the browser does early Downloads the HTML document only Downloads the page and its assets, runs its JavaScript and renders it in a hidden tab
What the visitor gains Skips the network wait for the HTML; images, CSS and scripts still load after the click The page appears almost instantly, often with a near-zero Largest Contentful Paint
Cost if the visitor never clicks One wasted HTML request A full page load: server work, bandwidth, analytics and ad scripts
Best for Broad rules across many links A few highly likely next pages, such as “next article” or the product page from a search result

What a Rule Looks Like

A rule set is plain JSON inside a script tag. This example prerenders any same-site link when the visitor shows intent, while excluding pages that should never be loaded speculatively:

<script type="speculationrules">
{
  "prerender": [{
    "where": {
      "and": [
        { "href_matches": "/*" },
        { "not": { "href_matches": "/logout" } },
        { "not": { "href_matches": "/cart/*" } },
        { "not": { "selector_matches": ".no-prerender" } }
      ]
    },
    "eagerness": "moderate"
  }]
}
</script>

These are called document rules: the browser scans the page for matching links, so you do not have to list every URL. You can also give a fixed "urls" list, or send the rules in a Speculation-Rules HTTP header that points to a JSON file. The header is useful when you cannot edit the page templates.

Eagerness: The Setting That Decides Your Bill

The eagerness field controls when a speculation fires, and it is the most important choice you will make.

  • immediate: start as soon as the rule is seen. Only sensible for a short list of URLs you are almost certain the visitor will open next.
  • eager: fire on the slightest signal of interest. On desktop that can be a very brief hover, and on mobile Chrome uses signals such as links coming into view.
  • moderate: on desktop, fire after the pointer rests on a link for around 200 milliseconds, or when the click begins. This is the sweet spot for most sites.
  • conservative: fire only when the visitor presses down on the link or touches it. That gives a smaller head start, but almost nothing is wasted.

Chrome also limits how many speculations can run at once, especially for prerender, and discards older ones as new ones start. That protects visitors, but it does not protect your server from a page full of eager rules. WordPress turned on a conservative, prefetch-only version of this by default in version 6.8. That is a good sign of where cautious defaults sit: start with prefetch and moderate or conservative eagerness, then add prerender only for the pages where it clearly pays off.

Prefetching is a cheap guess. Prerendering is an expensive one. Make it only when you are fairly sure.

The Side Effects Nobody Mentions in the Demo

Analytics and ads

A prerendered page runs its JavaScript, so a naive analytics tag can count a page view the visitor never saw. Major tools such as Google Analytics already wait until the page is actually shown, but custom scripts, older tag managers and ad impression pixels may not. The fix is simple: check document.prerendering, and if it is true, wait for the prerenderingchange event before firing anything that counts a view or an impression.

Server load and side effects

Every speculative request is a real request. The browser marks it with a Sec-Purpose: prefetch header, or prefetch;prerender for a prerender, so your logs and rate limits can tell it apart and your server can refuse it under load. More importantly, a GET request that changes something, such as a logout link, an “add to cart” URL or a one-click unsubscribe, can be triggered just by hovering. Those links should be excluded from your rules, and ideally they should not be GET requests at all.

Stale or personalized pages

A page prerendered a minute ago may show an old cart count or a price that has since changed. Pages that depend on login state should either be excluded or refresh that state when prerenderingchange fires. When a user logs out, the Clear-Site-Data header can also clear prefetch and prerender caches so a logged-in page is not served afterward.

Browser Support and Fallback

Chrome and Edge support speculation rules, including document rules and prerender. Other browsers have been experimenting with parts of the API. Browsers that do not understand the speculationrules script type simply ignore it, so adding rules never breaks a page. Visitors on unsupported browsers just get your normal load speed. That makes speculation rules a safe progressive enhancement, not a dependency.

A Safe Rollout in Five Steps

  1. Fix the basics first. Speculation hides a slow server for one click; it does not fix it. Make sure your Time to First Byte and caching are healthy.
  2. Start with prefetch at moderate eagerness for same-site links, excluding logout, cart, admin, search-with-side-effects and any URL that changes state.
  3. Make analytics and ads prerender-aware before you prerender anything.
  4. Add prerender selectively for the next likely page, then compare real-user LCP for speculated and normal navigations.
  5. Watch server metrics. Filter requests by the Sec-Purpose header to see how many speculations turn into real visits, and lower the eagerness if the hit rate is poor.

You can see speculations in action in Chrome DevTools under Application → Background services → Speculative loads, which lists each rule, each URL tried, and why any attempt failed.

En resumen

The Speculation Rules API is one of the rare performance upgrades that takes a few lines of JSON and makes a site feel dramatically faster. The risks are not technical breakage but wasted work: inflated page views, extra server load and links that do something when they should not. Begin with conservative prefetching, protect your state-changing URLs, and save prerender for the pages your visitors really are about to open.

Internet Pros builds fast, well-measured websites and can add speculative loading to your site with the right exclusions and analytics in place. Contáctanos for a page speed review.

Compartir:
Etiquetas: Diseño Web Desarrollo de software

Artículos relacionados