Last active
April 29, 2025 07:45
-
-
Save mattheu/46578643d9496a037f4762d8f3c7cc04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Speculative Loading Eager Prerender | |
* Description: Overrides WordPress speculative loading rules to use "eager" and "prerender" for better perceived performance. | |
* Version: 1.0 | |
* Author: Your Name | |
*/ | |
add_filter( | |
'wp_speculation_rules_configuration', | |
function ( $config ) { | |
if ( is_array( $config ) ) { | |
$config['mode'] = 'prerender'; | |
$config['eagerness'] = 'eager'; | |
} | |
return $config; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment