Speculative Loading in 6.8

<div style&equals;"text-align&colon;center"><&sol;div><div>&NewLine;<p>WordPress 6&period;8 introduces speculative loading&comma; which can lead to near-instant page load times by loading URLs before the user navigates to them&period; The feature relies on the <a href&equals;"https&colon;&sol;&sol;wicg&period;github&period;io&sol;nav-speculation&sol;speculation-rules&period;html">Speculation Rules API<&sol;a>&comma; a web platform feature that allows defining rules for which kinds of URLs to prefetch or prerender&comma; and how early such speculative loading should occur&period;<&sol;p>&NewLine;<p>Please refer to the <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;2024&sol;04&sol;09&sol;speculative-loading-in-wordpress&sol;">speculative loading announcement post<&sol;a> for additional information about the Speculation Rules API and related prior art in WordPress Core&period;<&sol;p>&NewLine;<h2 class&equals;"wp-block-heading">Context<&sol;h2>&NewLine;<p>Prior to being implemented in WordPress Core&comma; the feature has been successfully used on over 50&comma;000 WordPress sites via the <a href&equals;"https&colon;&sol;&sol;wordpress&period;org&sol;plugins&sol;speculation-rules&sol;">Speculative Loading feature plugin<&sol;a>&comma; which has been ported over to Core now&comma; with a <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;2025&sol;03&sol;06&sol;speculative-loading-in-6-8&sol;&num;default-behavior-and-customization" data-type&equals;"internal" data-id&equals;"&num;default-behavior-and-customization">few modifications<&sol;a>&period; Based on data queried from the <a href&equals;"https&colon;&sol;&sol;httparchive&period;org&sol;">HTTP Archive<&sol;a> and <a href&equals;"https&colon;&sol;&sol;developer&period;chrome&period;com&sol;docs&sol;crux">Chrome User Experience Report &lpar;CrUX&rpar;<&sol;a> datasets over all the time since the plugin launched&comma; the sites that enabled speculative loading improved their Largest Contentful Paint &lpar;LCP&rpar; passing rate by ~1&period;9&percnt; at the median which&comma; while it may seem a small number&comma; is a huge boost for a single feature&comma; considering that a lot of sites with various performance implications contribute to the data&period;<&sol;p>&NewLine;<p>The Speculation Rules API was first introduced in early 2023 and has seen ever increasing usage since then&period; Today&comma; <a href&equals;"https&colon;&sol;&sol;chromestatus&period;com&sol;metrics&sol;feature&sol;timeline&sol;popularity&sol;3932">over 8&percnt; of Chrome navigations rely on Speculation Rules<&sol;a>&period; A related significant launch happened a few months ago when <a href&equals;"https&colon;&sol;&sol;blog&period;cloudflare&period;com&sol;introducing-speed-brain&sol;">Cloudflare enabled speculative loading at large scale via its Speed Brain feature<&sol;a>&period;<&sol;p>&NewLine;<p>The Speculation Rules API is <a href&equals;"https&colon;&sol;&sol;caniuse&period;com&sol;mdn-html&lowbar;elements&lowbar;script&lowbar;type&lowbar;speculationrules">supported by Chrome&comma; Edge&comma; and Opera so far<&sol;a>&comma; which means the vast majority of end users browsing the web can benefit from its capabilities&period; For users of browsers without support for the API&comma; there are no adverse effects&comma; since the Speculation Rules API is a progressive enhancement&period; Browsers without support simply ignore its presence&comma; i&period;e&period; sites maintain the same behavior as before&period;<&sol;p>&NewLine;<h2 class&equals;"wp-block-heading" id&equals;"default-behavior-and-customization">Default behavior and customization<&sol;h2>&NewLine;<p>The WordPress Core implementation enables speculative loading by default in the frontend of all sites&comma; except when a user is logged in or when a site has pretty permalinks disabled&period; URLs are prefetched with conservative eagerness&colon; this means that prefetching is triggered when a user starts to click on a link&period; While this is typically only a fraction of a second before the actual navigation occurs&comma; it is still enough to lead to a notable performance improvement&period;<&sol;p>&NewLine;<p>This default of <code>prefetch<&sol;code> with <code>conservative<&sol;code> eagerness is used as a reasonable starting point to enable speculative loading at the scale of WordPress&period; It is in line with the configuration that Cloudflare uses in its speculative loading feature&comma; and it minimizes the chance of any speculative loads without a subsequent navigation to the URL&period; The Speculative Loading plugin uses a default of <code>prerender<&sol;code> with <code>moderate<&sol;code> eagerness&comma; which leads to a larger performance improvement due to the speculative load being triggered earlier as well as prerendering the URL&comma; but also has tradeoffs related to certain client-side behavior inadvertently being triggered even in case the user never ends up navigating to the URL&period;<&sol;p>&NewLine;<h3 class&equals;"wp-block-heading">Customization via actions and filters<&sol;h3>&NewLine;<h4 class&equals;"wp-block-heading" id&equals;"excluding-url-patterns">Excluding URL patterns from speculative loading<&sol;h4>&NewLine;<p>When a URL is prefetched&comma; the server response is loaded before the user navigates to it&period; In most cases&comma; this is not an issue since server responses for frontend URLs do not typically change the state of the site in any way&period; However&comma; there may be plugins that use the pattern of so-called &OpenCurlyDoubleQuote;action URLs”&comma; where simply navigating to a specific URL &lpar;with a <code>GET<&sol;code> request&rpar; a state change occurs—for example on an e-commerce WordPress site&comma; it could be adding a product to the shopping cart or marking an item as a favorite&period; It is worth noting that this is an antipattern&comma; since state changes should typically be triggered only by <code>POST<&sol;code> requests&comma; e&period;g&period; via form submissions&comma; and <code>GET<&sol;code> requests are supposed to be &OpenCurlyDoubleQuote;idempotent”&period; Despite that&comma; plugins that use this pattern should ensure that such URLs are excluded from prefetching and prerendering&period; In the case of <code>conservative<&sol;code> eagerness&comma; this should not be an issue since it’s almost guaranteed the user will also navigate to the URL&period; But for sites that use a more eager configuration there is a chance the navigation will never occur&comma; which is why excluding such URLs is important&period;<&sol;p>&NewLine;<p>By default&comma; any URLs that include query parameters are excluded from prefetching and prerendering automatically&comma; which should cater for the majority of such action URLs&period; However&comma; in case a plugin is implementing its own rewrite rules for these URLs instead of using custom query parameters&comma; they can use the <code>wp&lowbar;speculation&lowbar;rules&lowbar;href&lowbar;exclude&lowbar;paths<&sol;code> filter to provide URL patterns to exclude&period;<&sol;p>&NewLine;<p>This example ensures that any URLs with a path starting in &OpenCurlyDoubleQuote;&sol;cart&sol;” will be excluded from speculative loading&comma; regardless of whether it’s <code>prefetch<&sol;code> or <code>prerender<&sol;code>&colon;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;filter&lpar;&NewLine;&Tab;'wp&lowbar;speculation&lowbar;rules&lowbar;href&lowbar;exclude&lowbar;paths'&comma;&NewLine;&Tab;function &lpar; &dollar;href&lowbar;exclude&lowbar;paths &rpar; &lbrace;&NewLine;&Tab;&Tab;&dollar;href&lowbar;exclude&lowbar;paths&lbrack;&rsqb; &equals; '&sol;cart&sol;&ast;'&semi;&NewLine;&Tab;&Tab;return &dollar;href&lowbar;exclude&lowbar;paths&semi;&NewLine;&Tab;&rcub;&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>All URL patterns provided should follow the <a href&equals;"https&colon;&sol;&sol;urlpattern&period;spec&period;whatwg&period;org&sol;">URL Pattern web specification<&sol;a>&comma; and they will all be considered relative to the frontend of the site&period; For sites where the home URL is in a subdirectory&comma; WordPress will automatically prefix the corresponding path segment so that plugin developers do not need to worry about that&period;<&sol;p>&NewLine;<p>While WordPress Core’s default behavior is to prefetch URLs&comma; sites may opt in to prerendering URLs&period; This leads to a significant performance boost&comma; but also has additional implications on the speculatively loaded URLs&comma; since even their client-side code will be loaded&period; If a site contains any client-side logic that should only run once the user actually navigates to the URL&comma; it needs to check for whether the site is being prerendered first and only trigger such logic once the navigation has occurred &lpar;see <a href&equals;"https&colon;&sol;&sol;developer&period;chrome&period;com&sol;docs&sol;web-platform&sol;prerender-pages&num;detect-prerender-in-javascript">&OpenCurlyDoubleQuote;Detect prerender in JavaScript” documentation<&sol;a>&rpar;&period; A common use-case for that is analytics tooling &lpar;see <a href&equals;"https&colon;&sol;&sol;developer&period;chrome&period;com&sol;docs&sol;web-platform&sol;prerender-pages&num;impact-on-analytics">&OpenCurlyDoubleQuote;Impact on analytics” documentation<&sol;a>&rpar;&period; Many popular providers already support prerendering&comma; so no change is necessary&period; But if your site or your plugin includes such functionality on certain URLs and you haven’t updated the JavaScript logic to support prerendering yet&comma; you can temporarily exclude the relevant URLs from prerendering specifically&period;<&sol;p>&NewLine;<p>This example ensures that any URLs with a path starting in &OpenCurlyDoubleQuote;&sol;personalized-area&sol;” will be excluded from <code>prerender<&sol;code> speculative loading only&colon;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;filter&lpar;&NewLine;&Tab;'wp&lowbar;speculation&lowbar;rules&lowbar;href&lowbar;exclude&lowbar;paths'&comma;&NewLine;&Tab;function &lpar; &dollar;href&lowbar;exclude&lowbar;paths&comma; &dollar;mode &rpar; &lbrace;&NewLine;&Tab;&Tab;if &lpar; 'prerender' &equals;&equals;&equals; &dollar;mode &rpar; &lbrace;&NewLine;&Tab;&Tab;&Tab;&dollar;href&lowbar;exclude&lowbar;paths&lbrack;&rsqb; &equals; '&sol;personalized-area&sol;&ast;'&semi;&NewLine;&Tab;&Tab;&rcub;&NewLine;&Tab;&Tab;return &dollar;href&lowbar;exclude&lowbar;paths&semi;&NewLine;&Tab;&rcub;&comma;&NewLine;&Tab;10&comma;&NewLine;&Tab;2&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<h4 class&equals;"wp-block-heading">Modifying the default speculative loading configuration<&sol;h4>&NewLine;<p>As mentioned before&comma; WordPress sites are able to modify the default speculative loading configuration&period; For further improved performance&comma; you may want the configuration to be more eager or to leverage prerendering&period; This can be achieved via the <code>wp&lowbar;speculation&lowbar;rules&lowbar;configuration<&sol;code> filter&comma; which receives either an associative array with <code>mode<&sol;code> and <code>eagerness<&sol;code> keys to control the configuration&comma; or <code>null<&sol;code> to disable speculative loading for the current request&period;<&sol;p>&NewLine;<p>The default value for the filter is <code>array&lpar; 'mode' &equals;> 'auto'&comma; 'eagerness' &equals;> 'auto' &rpar;<&sol;code>&comma; unless a user is logged-in or the site has pretty permalinks disabled&comma; in which case the default value is <code>null<&sol;code>&period; For both configuration parameters&comma; the value auto signifies that WordPress Core will decide on the configuration&comma; which as of today effectively leads to a <code>mode<&sol;code> of <code>prefetch<&sol;code> and an <code>eagerness<&sol;code> of <code>conservative<&sol;code>&period; Depending on various criteria such as the state of the Speculation Rules API and ecosystem support&comma; the behavior may change in a future WordPress release&period;<&sol;p>&NewLine;<p>Here is an example that uses the filter to increase the eagerness to <code>moderate<&sol;code>&period; This will improve the performance benefits&comma; while increasing the tradeoff for a speculative load without subsequent navigation&colon;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;filter&lpar;&NewLine;&Tab;'wp&lowbar;speculation&lowbar;rules&lowbar;configuration'&comma;&NewLine;&Tab;function &lpar; &dollar;config &rpar; &lbrace;&NewLine;&Tab;&Tab;if &lpar; is&lowbar;array&lpar; &dollar;config &rpar; &rpar; &lbrace;&NewLine;&Tab;&Tab;&Tab;&dollar;config&lbrack;'eagerness'&rsqb; &equals; 'moderate'&semi;&NewLine;&Tab;&Tab;&rcub;&NewLine;&Tab;&Tab;return &dollar;config&semi;&NewLine;&Tab;&rcub;&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>The <code>mode<&sol;code> value can be either <code>auto<&sol;code>&comma; <code>prefetch<&sol;code>&comma; or <code>prerender<&sol;code>&comma; and the <code>eagerness<&sol;code> value can be either <code>auto<&sol;code>&comma; <code>conservative<&sol;code>&comma; <code>moderate<&sol;code>&comma; or <code>eager<&sol;code>&period; The Speculation Rules API also defines another eagerness value of <code>immediate<&sol;code>&comma; however that value is strongly discouraged for document-level rules that speculatively load any URLs&comma; so the WordPress Core API does not allow using it for its overall configuration&period;<&sol;p>&NewLine;<p>If you wanted to opt for an even greater performance boost&comma; here is an example that uses the filter to opt for <code>prerender<&sol;code> with <code>moderate<&sol;code> eagerness&period; This is similar to what the <a href&equals;"https&colon;&sol;&sol;wordpress&period;org&sol;plugins&sol;speculation-rules&sol;">Speculative Loading feature plugin<&sol;a> implements&comma; and it can lead to a significant performance boost&period; Please keep in mind the effects of prerendering on client-side JavaScript logic explained in the previous section before enabling <code>prerender<&sol;code>&period;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;filter&lpar;&NewLine;&Tab;'wp&lowbar;speculation&lowbar;rules&lowbar;configuration'&comma;&NewLine;&Tab;function &lpar; &dollar;config &rpar; &lbrace;&NewLine;&Tab;&Tab;if &lpar; is&lowbar;array&lpar; &dollar;config &rpar; &rpar; &lbrace;&NewLine;&Tab;&Tab;&Tab;&dollar;config&lbrack;'mode'&rsqb; &equals; 'prerender'&semi;&NewLine;&Tab;&Tab;&Tab;&dollar;config&lbrack;'eagerness'&rsqb; &equals; 'moderate'&semi;&NewLine;&Tab;&Tab;&rcub;&NewLine;&Tab;&Tab;return &dollar;config&semi;&NewLine;&Tab;&rcub;&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>As mentioned before&comma; speculative loading is disabled by default for sites that do not use pretty permalinks&period; This is because the aforementioned exclusion of URLs with query parameters would not reliably apply anymore if even WordPress Core’s arguments used query parameters&period; There may however be cases where&comma; as a site owner of a site without pretty permalinks&comma; you are confident that your site is not using any of the problematic patterns that are the reason for this exclusion in the first place&comma; or you already identified them and explicitly excluded URLs with the specific query parameters from being speculatively loaded&period; In that case&comma; you could use the filter to enable speculative loading&comma; as seen here&colon;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;filter&lpar;&NewLine;&Tab;'wp&lowbar;speculation&lowbar;rules&lowbar;configuration'&comma;&NewLine;&Tab;function &lpar; &dollar;config &rpar; &lbrace;&NewLine;&Tab;&Tab;if &lpar; &excl; &dollar;config && &excl; get&lowbar;option&lpar; 'permalink&lowbar;structure' &rpar; &rpar; &lbrace;&NewLine;&Tab;&Tab;&Tab;&dollar;config &equals; array&lpar;&NewLine;&Tab;&Tab;&Tab;&Tab;'mode' &equals;> 'auto'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;'eagerness' &equals;> 'auto'&comma;&NewLine;&Tab;&Tab;&Tab;&rpar;&semi;&NewLine;&Tab;&Tab;&rcub;&NewLine;&Tab;&Tab;return &dollar;config&semi;&NewLine;&Tab;&rcub;&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Please use caution when opting into speculative loading like this&period; WordPress Core’s defaults were carefully considered to cater for the majority of sites in a safe way&comma; so only use this code snippet if you are confident it will not have adverse effects on your site&period;<&sol;p>&NewLine;<h4 class&equals;"wp-block-heading">Including additional speculation rules<&sol;h4>&NewLine;<p>The Speculation Rules API allows defining multiple rules to configure how the browser should speculatively load URLs&period; By default&comma; WordPress Core only includes a single rule that handles all the aforementioned behavior&period; More advanced customization is possible by providing entirely new speculation rules in addition to Core’s main rule&comma; which can be accomplished by using the <code>wp&lowbar;load&lowbar;speculation&lowbar;rules<&sol;code> action&period; The action receives an instance of the new <code>WP&lowbar;Speculation&lowbar;Rules<&sol;code> class&comma; which has validation mechanisms built in and can be amended as needed&period; By adding new rules&comma; you can implement entirely custom configurations that will be applied on top of WordPress Core’s main rule&period;<&sol;p>&NewLine;<p>Here is an example&comma; which directly relates to the previous example that changes the default configuration to <code>prerender<&sol;code> with <code>moderate<&sol;code> eagerness&period; You may prefer not to change the default&comma; but there may be specific URLs where you would like to enable <code>prerender<&sol;code> with <code>moderate<&sol;code> eagerness&period; You could add a custom URL-level speculation rule for that&colon;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;action&lpar;&NewLine;&Tab;'wp&lowbar;load&lowbar;speculation&lowbar;rules'&comma;&NewLine;&Tab;function &lpar; WP&lowbar;Speculation&lowbar;Rules &dollar;speculation&lowbar;rules &rpar; &lbrace;&NewLine;&Tab;&Tab;&dollar;speculation&lowbar;rules->add&lowbar;rule&lpar;&NewLine;&Tab;&Tab;&Tab;'prerender'&comma;&NewLine;&Tab;&Tab;&Tab;'my-moderate-prerender-url-rule'&comma;&NewLine;&Tab;&Tab;&Tab;array&lpar;&NewLine;&Tab;&Tab;&Tab;&Tab;'source' &equals;> 'list'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;'urls' &equals;> array&lpar;&NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;'&sol;some-url&sol;'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;'&sol;another-url&sol;'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;'&sol;yet-another-url&sol;'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;&rpar;&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;'eagerness' &equals;> 'moderate'&comma;&NewLine;&Tab;&Tab;&Tab;&rpar;&NewLine;&Tab;&Tab;&rpar;&semi;&NewLine;&Tab;&rcub;&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Taking this example further&comma; maybe there is no easy way to provide a list of URLs&comma; e&period;g&period; in case they change often or more URLs need to be added regularly&period; In that case&comma; you consider using a document-level speculation rule that applies for all links that are marked with a specific class&comma; or where a parent element has a specific class&colon;<&sol;p>&NewLine;<div class&equals;"wp-block-syntaxhighlighter-code ">&NewLine;<pre class&equals;"brush&colon; php&semi; title&colon; &semi; notranslate">&NewLine;add&lowbar;action&lpar;&NewLine;&Tab;'wp&lowbar;load&lowbar;speculation&lowbar;rules'&comma;&NewLine;&Tab;function &lpar; WP&lowbar;Speculation&lowbar;Rules &dollar;speculation&lowbar;rules &rpar; &lbrace;&NewLine;&Tab;&Tab;&dollar;speculation&lowbar;rules->add&lowbar;rule&lpar;&NewLine;&Tab;&Tab;&Tab;'prerender'&comma;&NewLine;&Tab;&Tab;&Tab;'my-moderate-prerender-optin-rule'&comma;&NewLine;&Tab;&Tab;&Tab;array&lpar;&NewLine;&Tab;&Tab;&Tab;&Tab;'source' &equals;> 'document'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;'where' &equals;> array&lpar;&NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;'selector&lowbar;matches' &equals;> '&period;moderate-prerender&comma; &period;moderate-prerender a'&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;&rpar;&comma;&NewLine;&Tab;&Tab;&Tab;&Tab;'eagerness' &equals;> 'moderate'&comma;&NewLine;&Tab;&Tab;&Tab;&rpar;&NewLine;&Tab;&Tab;&rpar;&semi;&NewLine;&Tab;&rcub;&NewLine;&rpar;&semi;&NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>With this rule in place&comma; users would be able to add a <code>moderate-prerender<&sol;code> class to any block that supports the advanced UI for adding classes&comma; and that way they could manually opt in any link on demand&period;<&sol;p>&NewLine;<p>Please refer to the <a href&equals;"https&colon;&sol;&sol;wicg&period;github&period;io&sol;nav-speculation&sol;speculation-rules&period;html">Speculation Rules API<&sol;a> specification for details on what a rule definition can look like&period;<&sol;p>&NewLine;<h3 class&equals;"wp-block-heading">Customization via UI<&sol;h3>&NewLine;<p>The previous example already hints at how speculative loading can be customized via the UI&period; While a dedicated UI for the feature like it exists in the <a href&equals;"https&colon;&sol;&sol;wordpress&period;org&sol;plugins&sol;speculation-rules&sol;">Speculative Loading feature plugin<&sol;a> is out of scope for WordPress Core&comma; many block types provide an &OpenCurlyDoubleQuote;Additional CSS class&lpar;es&rpar;” field in the &OpenCurlyDoubleQuote;Advanced” panel in the block sidebar&period;<&sol;p>&NewLine;<p>WordPress Core has built-in support for the CSS classes <code>no-prefetch<&sol;code> and <code>no-prerender<&sol;code>&period; You can add these to any block so that links within that block are opted out of prefetching or prerendering respectively&period; Note that <code>no-prefetch<&sol;code> opts out of both&comma; i&period;e&period; opts out of speculative loading entirely&comma; since prefetching is part of prerendering&period; Please refer to the <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;2025&sol;03&sol;06&sol;speculative-loading-in-6-8&sol;&num;excluding-url-patterns" data-type&equals;"internal" data-id&equals;"&num;excluding-url-patterns">section about excluding URL patterns<&sol;a> for guidance on when it may be useful to exclude URLs from prefetching or prerendering&period;<&sol;p>&NewLine;<p>This mechanism makes it easy for advanced users to take granular control over speculative loading for specific blocks&period;<&sol;p>&NewLine;<h2 class&equals;"wp-block-heading">Summary and further reading<&sol;h2>&NewLine;<p>The speculative loading feature in WordPress 6&period;8 is a great win for performance of WordPress and the web overall&comma; by starting the page load process even before the user navigation occurs&period; By fine-tuning it further based on your site’s needs&comma; you can achieve even greater performance boosts than with the default configuration&period;<&sol;p>&NewLine;<p>Please see the following links for further reading&colon;<&sol;p>&NewLine;<ul class&equals;"wp-block-list">&NewLine;<li>Trac ticket <a href&equals;"https&colon;&sol;&sol;core&period;trac&period;wordpress&period;org&sol;ticket&sol;62503">&num;62503<&sol;a> and changeset <a href&equals;"https&colon;&sol;&sol;core&period;trac&period;wordpress&period;org&sol;changeset&sol;59837">&lbrack;59837&rsqb;<&sol;a> for additional context and discussion about the Core implementation&period;<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;2024&sol;04&sol;09&sol;speculative-loading-in-wordpress&sol;">Speculative loading announcement post<&sol;a> for Core<&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;developer&period;chrome&period;com&sol;docs&sol;web-platform&sol;prerender-pages">Chrome developer article on using the Speculation Rules API<&sol;a><&sol;li>&NewLine;<li><a href&equals;"https&colon;&sol;&sol;developer&period;chrome&period;com&sol;docs&sol;devtools&sol;application&sol;debugging-speculation-rules">Chrome developer article on debugging Speculation Rules<&sol;a><&sol;li>&NewLine;<&sol;ul>&NewLine;<p class&equals;"has-text-align-right"><em>Props to <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;westonruter&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>westonruter<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;tunetheweb&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>tunetheweb<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;adamsilverstein&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>adamsilverstein<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;profiles&period;wordpress&period;org&sol;joemcgill&sol;" class&equals;"mention"><span class&equals;"mentions-prefix">&commat;<&sol;span>joemcgill<&sol;a> for review and proofreading&period;<&sol;em><&sol;p>&NewLine;<p class&equals;"o2-appended-tags"><a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;6-8&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>6-8<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;dev-notes&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>dev-notes<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;dev-notes-6-8&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>dev-notes-6-8<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;feature-projects&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>feature-projects<&sol;a>&comma; <a href&equals;"https&colon;&sol;&sol;make&period;wordpress&period;org&sol;core&sol;tag&sol;performance&sol;" class&equals;"tag"><span class&equals;"tag-prefix">&num;<&sol;span>performance<&sol;a><&sol;p>&NewLine;<&sol;div>&NewLine;

Sponsored
Sponsored
A WordPress Commenter

Recent Posts

Cloudways Brings Back Prepathon Next Week With Focus on Gen Z and Gen Alpha

Cloudways is bringing back its free Prepathon online event next week, from September 30 to…

3 days ago

Fueled Layoffs Spark Tension After Former Employee Pre-Empts Announcement

Fueled has confirmed layoffs this week, cutting 4–5% of its workforce. But the news reached…

3 days ago

Nick Hamze’s ‘Cool Kids’ Post Kicks Off Fresh Debate on WordPress’s Image Problem

After calling for “more weirdness” in WordPress theme design earlier this year, Nick Hamze has…

4 days ago

New FAIR 1.0 Release Brings Decentralized Package Management to WordPress

FAIR has reached its first major milestone with the release of version 1.0 this week,…

5 days ago

Performance Chat Summary: 23 September 2025

The full chat log is available beginning here on Slack. WordPress Performance Trac tickets @westonruter…

5 days ago

From RV Life to CEO: Jon Penland’s Unlikely Road to Leading Kinsta

Back in 2011, Jon Penland was selling centrifugal pumping units into the water and wastewater…

7 days ago