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

Pairing dns-prefetch and preconnect #30096

Closed
jquinc30 opened this issue Nov 7, 2023 · 1 comment · Fixed by #30315
Closed

Pairing dns-prefetch and preconnect #30096

jquinc30 opened this issue Nov 7, 2023 · 1 comment · Fixed by #30315
Labels
Content:Performance Web performance docs effort: small This task is a small effort. goal: up-to-date (Experimental label) Issues about outdated content.

Comments

@jquinc30
Copy link
Contributor

jquinc30 commented Nov 7, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch

What specific section or headline is this issue about?

#best_practices

What information was incorrect, unhelpful, or incomplete?

preconnect will perform the dns lookup but also establishes a connection to a server where dns-prefetch will only do the first part.

The best practice encourage to use both:

The logic behind pairing these hints is because support for dns-prefetch is better than support for preconnect.

What did you expect to see?

As the support for preconnect seems to be pretty ok now and httpS is the standard (where the potential gain of preconnect is at the maximum), I think that pairing is no more useful.
I was expected to be encouraged to only use preconnect

Do you have any supporting links, references, or citations?

https://caniuse.com/link-rel-dns-prefetch

https://caniuse.com/link-rel-preconnect

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@jquinc30 jquinc30 added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 7, 2023
@github-actions github-actions bot added the Content:Performance Web performance docs label Nov 7, 2023
@caugner caugner added goal: up-to-date (Experimental label) Issues about outdated content. effort: small This task is a small effort. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Nov 9, 2023
@pepelsbey
Copy link
Member

pepelsbey commented Nov 14, 2023

Hello! Good catch :) I agree that support is good enough for this hint to become obsolete. However, I would keep this note:

If a page needs to make connections to many third-party domains, preconnecting them all is counterproductive. The preconnect hint is best used for only the most critical connections. For the others, just use <link rel="dns-prefetch"> to save time on the first step — the DNS lookup.

Feel free to file a PR with fixes!

jquinc30 added a commit to jquinc30/content that referenced this issue Nov 16, 2023
zfox23 added a commit that referenced this issue Nov 16, 2023
* fix: remove pairing with preconnect from Best Practices section

cf issue #30096

* Update files/en-us/web/performance/dns-prefetch/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/performance/dns-prefetch/index.md

Co-authored-by: Zach Fox <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Zach Fox <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Performance Web performance docs effort: small This task is a small effort. goal: up-to-date (Experimental label) Issues about outdated content.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants