зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1888815 - Do not set the NS_HTTP_REFRESH_DNS flag unless force-reloading the page r=necko-reviewers,jesup
This flag was previously being set for every page reload. Only setting it for force-reload makes it so that we don't needlessly refresh DNS cache entries and improves page load performance. Differential Revision: https://phabricator.services.mozilla.com/D208141
This commit is contained in:
Родитель
9e46b19a38
Коммит
622e7e0067
|
@ -12478,6 +12478,15 @@
|
||||||
value: 24
|
value: 24
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
|
# This makes it so NS_HTTP_REFRESH_DNS is only
|
||||||
|
# set on DNS resolutions when LOAD_FRESH_CONNECTION is set.
|
||||||
|
# That's because we don't need to refresh DNS on
|
||||||
|
# every page reload.
|
||||||
|
- name: network.dns.only_refresh_on_fresh_connection
|
||||||
|
type: RelaxedAtomicBool
|
||||||
|
value: true
|
||||||
|
mirror: always
|
||||||
|
|
||||||
# The proxy type. See nsIProtocolProxyService.idl
|
# The proxy type. See nsIProtocolProxyService.idl
|
||||||
# PROXYCONFIG_DIRECT = 0
|
# PROXYCONFIG_DIRECT = 0
|
||||||
# PROXYCONFIG_MANUAL = 1
|
# PROXYCONFIG_MANUAL = 1
|
||||||
|
|
|
@ -6628,8 +6628,10 @@ nsresult nsHttpChannel::BeginConnect() {
|
||||||
Unused << gHttpHandler->AddConnectionHeader(&mRequestHead, mCaps);
|
Unused << gHttpHandler->AddConnectionHeader(&mRequestHead, mCaps);
|
||||||
|
|
||||||
if (!LoadIsTRRServiceChannel() &&
|
if (!LoadIsTRRServiceChannel() &&
|
||||||
(mLoadFlags & VALIDATE_ALWAYS ||
|
((mLoadFlags & LOAD_FRESH_CONNECTION) ||
|
||||||
BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass()))) {
|
(!StaticPrefs::network_dns_only_refresh_on_fresh_connection() &&
|
||||||
|
(mLoadFlags & VALIDATE_ALWAYS ||
|
||||||
|
BYPASS_LOCAL_CACHE(mLoadFlags, LoadPreferCacheLoadOverBypass()))))) {
|
||||||
mCaps |= NS_HTTP_REFRESH_DNS;
|
mCaps |= NS_HTTP_REFRESH_DNS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ add_task(async function testIPHintWithFreshDNS() {
|
||||||
);
|
);
|
||||||
|
|
||||||
let chan = makeChan(`https://test.iphint.org/server-timing`);
|
let chan = makeChan(`https://test.iphint.org/server-timing`);
|
||||||
chan.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
|
chan.loadFlags |= Ci.nsIRequest.LOAD_FRESH_CONNECTION;
|
||||||
let [req] = await channelOpenPromise(
|
let [req] = await channelOpenPromise(
|
||||||
chan,
|
chan,
|
||||||
CL_EXPECT_FAILURE | CL_ALLOW_UNKNOWN_CL
|
CL_EXPECT_FAILURE | CL_ALLOW_UNKNOWN_CL
|
||||||
|
@ -337,7 +337,7 @@ add_task(async function testIPHintWithFreshDNS() {
|
||||||
});
|
});
|
||||||
|
|
||||||
chan = makeChan(`https://test.iphint.org/server-timing`);
|
chan = makeChan(`https://test.iphint.org/server-timing`);
|
||||||
chan.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
|
chan.loadFlags |= Ci.nsIRequest.LOAD_FRESH_CONNECTION;
|
||||||
[req] = await channelOpenPromise(chan);
|
[req] = await channelOpenPromise(chan);
|
||||||
Assert.equal(req.protocolVersion, "h2");
|
Assert.equal(req.protocolVersion, "h2");
|
||||||
let internal = req.QueryInterface(Ci.nsIHttpChannelInternal);
|
let internal = req.QueryInterface(Ci.nsIHttpChannelInternal);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче