Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.19 - Preconnect to external domains - Filter to change the method part #7295

Open
piotrbak opened this issue Feb 6, 2025 · 1 comment
Open
Milestone

Comments

@piotrbak
Copy link
Contributor

piotrbak commented Feb 6, 2025

User Story

As a user, I want to apply prefetch to eligible domains instead of using preconnect using a filter

Acceptance Criteria

  • Filter should be guarded
  • By enabling this filter we’ll change preconnect to dns-prefetch
    • <link rel="dns-prefetch" href="https://fonts.googleapis.com/" />
@piotrbak piotrbak added this to the 3.19-alpha milestone Feb 6, 2025
@wordpressfan
Copy link
Contributor

That's already handled here:

if ( $this->use_prefetch( $domain ) ) {
// Use dns-prefetch.
return $this->dns_prefetch_link(
[
'href' => esc_url( $domain ),
1 => 'crossorigin',
2 => 'data-rocket-prefetch',
]
);
}

and the filter is here:

return wpm_apply_filters_typed( 'boolean', 'rocket_preconnect_external_domains_use_prefetch', false, $domain );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants