3

This is a question about dns-prefetch and preconnect, and possible optimizations:

  • If a resource is cached, are dns-prefetch and preconnect still doing their job?
  • If not, is it possible to optimize this behavior so that dns-prefetch and preconnect do their job only for non-cached resources?
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Evgeniy
  • 2,337
  • 2
  • 28
  • 68
  • 1
    [An answer on another tread](https://stackoverflow.com/a/51059127/3025856) suggests not using `preconnect` for static resources that are _likely_ going to be cached (e.g., from a CDN) since you’ll be establishing the connection without ever needing it. In that case, however, `dns-prefetch` remains useful as it’s a much cheaper operation, and the results are cached. – Jeremy Caney Oct 08 '20 at 18:01

0 Answers0