6

I've been reading up on using dns-prefetch and preconnect. Obviously they should be used, because every little bit helps.

dns-prefetch has a lot better support across browsers than preconnect. So my question is, if a browser doesn't support preconnect, does it fall back to a dns-prefetch? My thinking is preconnect is basically dns-prefetch with some extra sauce (tls negotiations, what not). But I could also see how that isn't the case.

Next, if I am wanting something to preconnect, but want to make sure the dns-prefetch at least works, should I include both? Is that optimal?

halfer
  • 19,824
  • 17
  • 99
  • 186
Kyle Hawk
  • 429
  • 4
  • 16

1 Answers1

6

I was looking answer for the same question and i found this thread on reddit: https://www.reddit.com/r/webdev/comments/80w8c0/some_questions_regarding_preconnect_and/ and there was a link to a Twitter post: https://twitter.com/csswizardry/status/962313751818113024 which states:

Question:

Performance experts, shall we use dns-prefetch or preconnect for things like CDN?

preconnect seems to have a bigger impact but has a lesser support. Can we use both safely?

I can’t seem to find a definitive answer as to which to use when.

Answer:

Use both. Put your preconnects first.

halfer
  • 19,824
  • 17
  • 99
  • 186
daniyel
  • 652
  • 10
  • 28