← Back to context

Comment by gpm

7 years ago

Why does DNS cache expiration need to be in the critical path?

Instead of a browser doing

1. Local DNS lookup (resulting in expired entry)

2. DNS query

3. DNS response

4. HTTP request

why not do

1. Local DNS lookup (resulting in expired entry)

2.1. DNS query

2.2. HTTP request

3. DNS response

4. If DNS response changed and HTTP request failed, HTTP request again

Maybe use two expiration lengths, one that results in flow 2 and a much longer one that results in flow 1.

Ya, this is roughly what the fb apps do. Dns rarely blocks, and changes are seen quickly.

Probably because the gain in milliseconds is not worth the code complexity of parallell executing code.