Skip to content

Conversation

@westonruter
Copy link
Member

Fixes #2118

Before

This plugin adds support for the Speculation Rules API, which allows defining rules by which certain URLs are dynamically prefetched or prerendered.

See the Speculation Rules WICG specification draft.

By default, the plugin is configured to prerender WordPress frontend URLs when the user interacts with a relevant link. This can be customized via the "Speculative Loading" section in the Settings > Reading admin screen.

A filter can be used to exclude certain URL paths from being eligible for prefetching and prerendering (see FAQ section). Alternatively, you can add the no-prerender CSS class to any link (<a> tag) that should not be prerendered. See FAQ for more information.

After

This plugin adds support for the Speculation Rules API, which allows defining rules by which certain URLs are dynamically prefetched or prerendered. This core Speculative Loading functionality was merged into WordPress 6.8, but it only prefetches with conservative eagerness by default. In contrast, this plugin defaults to prerendering with moderate eagerness (i.e. when interacting with a link), and it provides a user interface to customize the mode and eagerness via the "Speculative Loading" section on the Settings > Reading admin screen.

A filter can be used to exclude certain URL paths from being eligible for prefetching and prerendering (see FAQ section). Alternatively, you can add the no-prerender CSS class to any link (<a> tag) that should not be prerendered. See FAQ for more information.

@westonruter westonruter added this to the speculation-rules n.e.x.t milestone Aug 6, 2025
@westonruter westonruter requested a review from desrosj August 6, 2025 01:35
@westonruter westonruter requested a review from felixarntz as a code owner August 6, 2025 01:35
@westonruter westonruter added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Speculative Loading Issues for the Speculative Loading plugin (formerly Speculation Rules) labels Aug 6, 2025
@github-actions
Copy link

github-actions bot commented Aug 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: desrosj <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter changed the title Update description to note core merge Update Speculative Loading readme description to note core merge Aug 6, 2025
@westonruter westonruter changed the title Update Speculative Loading readme description to note core merge Update Speculative Loading readme description to note purpose after core merge Aug 6, 2025
@westonruter westonruter requested a review from swissspidy August 6, 2025 01:36
Copy link
Member

@desrosj desrosj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @westonruter!

@swissspidy swissspidy merged commit 347a3de into trunk Aug 6, 2025
17 checks passed
@swissspidy swissspidy deleted the update/speculative-loading-readme branch August 6, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Speculative Loading Issues for the Speculative Loading plugin (formerly Speculation Rules) [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify the purpose of the Speculative Loading plugin post WP 6.8

4 participants