In order to improve the load time of a webpage, WordPress Performance team has released a plugin called Speculative Loading.
Speculative Loading is a new technology that fetches a web page or resource before users open it.
It works like that, when a user hover over a link that is present in a webpage, the speculative loading technology dynamically prefetch and/or prerender the link before the user navigates into it.
The speculative loading technology basically works on the newly introduced Speculation Rules API that allows rules to dynamically prerender a webpage or resource before opening it.
The prerendering includes the Javascript files present in the webpage as well. And, that is how we get the nearly instant loading times.
Mozilla Developer Pages has explained about Speculation Rules API as it improves performance for future navigations.
Hence, suitable for Multi Page applications (MPAs) not single page applications (SPAs).
What is the difference between Speculative Loading and the existing technologies?
While prefetch and pre-rendering is not a new technology, we already have the rel=”prefetch” feature.
However, the speculative loading API came with various improvements like it is more expressive, has configurable syntax to specify which documents to prefetch or pre-render.
How to Add Speculative Loading in WordPress?
To enable speculative loading in your WordPress website, you need to first install and enable the speculative loading plugin from the WordPress repository.
Once you install the plugin, go to the Settings > Reading > Speculative Loading.
Do note that, the full functionalities of Speculative API is currently supported by Chrome 121 (which was released early this year) and its higher versions.
However, if the browser doesn’t support the speculative API, it doesn’t affect the webpage’s user experience.
Hence, it is safe to use this plugin in your WordPress website.
This is not the first time WordPress has started taking into consideration that the website speed is now one of the crucial factors among to most to succeed over the web.
In WordPress 5.9 they improves the editor and front end performance by adding the lazy loading tech by default as well as several other improvements for better LCP.
So, how many of you are interested in adding Speculative Loading technology in your WordPress website? Please let me know its impact