During the holidays I had enough time to go trough entire WordPress 6.8 Field Guide, and from a developer perspective I can point out two important improvements.
Security is now more strengten by replacing phpass with bcrypt for password hashing which improved resistance to brute-force attacks and it is now alignned with current industry best practices. Offcourse we still should use well established security practice, but having extra protective layer from the start with bcrypt hashing which takes a lot more computing power to break is a really good thing.
Speculative Loading is by far most important feature since it has great impact for a single feature which is measured by improving Largest Contentful Paint (LCP) passing rate by ~1.9%, and by further fine tuning you can achieve almost instant loading.
It was first introduced in 2023, and it is available as Speculative Loading plugin created by Performance Team but it is finally moved to core. It speculatively preloads URLs before navigating to them, leading to faster rendering times and improved user experiences.
Plugin comes with more aggressive setup (prerender with moderate eagerness) which of course can be achieved with fine tuning in default WordPress 6.8 setup with a fillter:
add_filter(
'wp_speculation_rules_configuration',
function ( $config ) {
if ( is_array( $config ) ) {
$config['mode'] = 'prerender';
$config['eagerness'] = 'moderate';
}
return $config;
}
);
And it is possible to implement custom configurations that will be applied on top of the main rule by providing list of urls or even better by using document level rule that apply to links with a specific CSS class:
add_action(
'wp_load_speculation_rules',
function ( WP_Speculation_Rules $speculation_rules ) {
$speculation_rules->add_rule(
'prerender',
'my-moderate-prerender-optin-rule',
array(
'source' => 'document',
'where' => array(
'selector_matches' => '.moderate-prerender, .moderate-prerender a',
),
'eagerness' => 'moderate',
)
);
}
);
For more aggressive setup, links with integrated dynamic loading or some other functionality have to be ommited (e.g. load more). Beside config for omitting theses links, there are already available CSS classes no-prefetch and no-prerender that you can simpy add to those elements.
The Speculation Rules API is supported by Chrome, Edge, and Opera so far, and with pretty permalinks ENABLED, in other words vast majority of users on the web.
With this single feature you might be able to achieve almost the speed like Wes Bos explained in “How is this website so fast?” https://lnkd.in/dfHep-HF , well not exactly, but immense feeling of speed improvement is inevitable.

Leave a Reply