Preloading and Speculation Rules API
by Quentin Couchaux April 2nd 2025

In the ongoing quest for faster and smoother navigation, Google Chrome has introduced a new feature: the Speculation Rules API. Designed to enhance loading performance by anticipating user navigation intent, this API represents a significant evolution from previous preloading techniques.
What is the Speculation Rules API?
The Speculation Rules API allows web browsers—particularly Chrome—to prerender the pages a user is most likely to visit next. In other words, the browser can begin loading certain targeted pages in the background before the user even clicks, drastically reducing display time.
This feature is not enabled by default. It can be configured at various system levels, including for developers using Hyvä Themes (in Magento), where it can be activated via: Experimental Features > Enable Preloading Speculation Rules
A Modern Alternative to <link rel="prerender">
The older prerendering method (<link rel="prerender" href="...">
) had several limitations:
- Limited support (mostly Chrome),
- Occasionally unpredictable behavior,
- Minimal control over triggers.
The Speculation Rules API modernizes this approach. Based on a JSON rules file, it allows developers to:
- Precisely define which pages should be prerendered,
- Control when and under what conditions prerendering occurs,
- Seamlessly integrate this logic into modern contexts like SPAs (Single Page Applications).
The API relies on detection and prediction mechanisms:
When a user hovers over a link, starts typing in the address bar, or interacts with specific navigation elements, the browser refers to the defined speculation rules to prerender the corresponding page.
This may include loading HTML, CSS, JavaScript, and even associated data in the background—so that, if the user confirms the action, the final rendering feels almost instantaneous.
Why Does This Matter for UX (and SEO)?
This technology can significantly improve user experience by offering:
- Reduced perceived latency,
- A smooth, app-like browsing experience,
- Higher user engagement thanks to faster response times.
Since Google increasingly values UX performance (especially through Core Web Vitals), this API can also positively influence SEO—provided it’s used correctly.
Specifics for Hyvä Themes
In the Magento + Hyvä Themes context, this feature can be enabled via:
Admin Panel > Stores > Configuration > Hyvä Themes > Experimental Features > Enable Preloading Speculation Rules
This makes it easy to integrate prerendering logic into Magento pages—particularly valuable for e-commerce sites, where fast navigation is crucial for improving conversion rates.
For whom? 🤔
👉🏼 All types of clients, but particularly those with TMA.
Client benefits 🎯
👉🏼 Customer rate optimization and improvement of user navigation.
You have an e-commerce project and want to discuss it with our experts?
Find out what’s new at the company.
Because mixing fun and work is at the heart of our philosophy, we always try to make a special place for it in our business life.