wintermeyer
wintermeyer

Reputation: 8318

enable DNS pre-resolution and TCP pre-connection

How can I enable DNS pre-resolution and TCP pre-connection in a Chrome browser (Mac OS X), when the chrome://dns page tells that "DNS pre-resolution and TCP pre-connection is disabled"?

enter image description here

Upvotes: 5

Views: 5182

Answers (2)

jakub.g
jakub.g

Reputation: 41268

FWIW I had the behavior as in Q&A above in Chrome on Windows:

  • chrome://dns says "DNS pre-resolution and TCP pre-connection is disabled.",

whereas

  • chrome://settings shows "Use a prediction service to load pages more quickly" as ticked

I was wondering how this relates to <link rel="dns-prefetch" href="//some.domain"> and <link rel="preconnect" href="https://some.domain">.

Browsers:

  • Chrome 67 stable with uBlock
  • Chrome 68 beta (no extensions)

Before the tests

  • have chrome://dns tell you that the services are disabled (perhaps by installing uBlock)
  • serve the following HTMLs on localhost

    <!doctype html><html><head>
        <link rel="dns-prefetch" href="//ajax.googleapis.com">
    </head><body></html>
    
    <!doctype html><html><head>
        <link rel="preconnect" href="https://ajax.googleapis.com">
    </head><body></html>
    

Test 1: with Fiddler

  • go to chrome://net-internals/#dns and clear host cache
  • enable Fiddler and make it listen to the traffic
  • open new tab in Chrome on http://localhost
  • observe Fiddler to have a "Tunnel to ajax.googleapis.com:443" session

Test 2: without Fiddler

  • go to chrome://net-internals/#dns and clear host cache
  • open new tab in Chrome on http://localhost
  • refresh chrome://net-internals/#dns and observe DNS entries

Results and conclusions:

  • Chrome 67 stable with uBlock: preload always works; dns-prefetch is blocked by uBlock if uBlock setting Disable pre-fetching (to prevent any connection for blocked network requests) is enabled
  • Chrome 68 beta (no extensions): both dns-prefetch and preload work
  • At this point it's hard to say which of those behaviors are features or bugs and in which part of the stack.

Upvotes: 2

wintermeyer
wintermeyer

Reputation: 8318

It's in the advanced settings and called "Predict network actions to improve page load performance"

Screenshot

Upvotes: 4

Related Questions