Chrome DNS cache has negative TTL and expires just after a minute

1

There is a similar question here, Why does Chrome have TTL -1000 in the DNS Cache? but it has not answer either.

When I visit, chrome://net-internals/#dns I see a lot of DNS cache with -1000 value. When I click Clear host cache and visit new website, I get new cache with same negative value and it expires within a minute or so.

Can someone please explain this?

MaverickD

Posted 2018-10-22T07:52:58.147

Reputation: 113

Answers

0

From my own observation, the TTL column is meaningless and always contains the value of -1000. I can only theorize that this is because Chrome's DNS cache does not follow the standards and does its own thing. See below for more.

The Unix Stack Exchange post Chromium/Chrome does not cache DNS requests more than a minute quotes answers from bugs-chromium - Issue 164026 - DNS TTL not honored from Apr 21 2011, which was closed on Oct 10 2013 as "WontFix (obsolete/works as intended)"

It brings this quote from the bug report :

The HostCache currently assumes TTL=60s for all positive results. With asynchronous DNS resolver, we plan to use TTL=max(60s, server_reported_ttl), i.e., at least 60s. The rationale is to improve the cache performance. (When a CDN NS provides TTL=10-20s, and it takes 30s+ to fetch all subresources, we often have to re-query for the same hostname during one page load.)

Further, while Chrome marks after a minute the entries in the cache as [Expired], the entries just stay there. I have not tried to measure for how long, but they were still there for at least 15 minutes after expiration.

My conclusion is that Chrome cuts quite a few corners in the quest for speed, even disobeying DNS rules. Specifically, it ignores the TTL value, marking all entries as expired after only one minute, but then goes ahead and keeps those entries for an unknown (to me) period of time.

The value in the TTL column, and the [Expired] mark, have no real meaning. Chrome will continue to value speed above many other considerations.

harrymc

Posted 2018-10-22T07:52:58.147

Reputation: 306 093